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

ID: 18218
Updated by: daniel.oconnor@gmail.com
Reported By: cogo at starzinger dot net
Summary: "pear package" does not allow the use of late static
binding
Status: Open
Type: Bug
Package: PEAR
Operating System: Linux
Package Version: 1.9.1
PHP Version: 5.3.1
-Assigned To:
+Assigned To: saltybeagle
Roadmap Versions:
New Comment:

-Assigned To:
+Assigned To: saltybeagle



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

[2011-01-24 22:48:17] christer

Added #patch
bug:18218;patch:support_late_static_binding;revision:1295909297;.

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

[2011-01-24 22:47:44] christer

Description:
------------
The bug has been previously reported (#17652) but was marked as bogus. I
added a comment and a patch to that bug report, but will add them again
here.

Test script:
---------------
class Autoload {
static public $classes = array(
// ...
);

static public function load($class) {
$className = strtolower($class);

if (isset(static::$classes[$className])) {
require dirname(__DIR__) . static::$classes[$className];
}
}
}

Expected result:
----------------
No errors

Actual result:
--------------
If something like the above code is in a PHP script when trying to build
a package pear will inform you that the file has invalid php code. The
reason is that the Validator.php class only allows T_WHITESPACE and
T_STRING in front of the T_DOUBLE_COLON. If you change the source to
"self::$classes" instead of "static::$classes" pear does not complain.

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

Search Discussions

  • Brett Bieber at Feb 20, 2011 at 5:29 pm
    Edit report at http://pear.php.net/bugs/bug.php?id=18218&edit=1

    ID: 18218
    Updated by: brett.bieber@gmail.com
    Reported By: cogo at starzinger dot net
    Summary: "pear package" does not allow the use of late static
    binding
    -Status: Assigned
    +Status: Open
    Type: Bug
    Package: PEAR
    Operating System: Linux
    Package Version: 1.9.1
    PHP Version: 5.3.1
    Assigned To: saltybeagle
    Roadmap Versions:
    New Comment:

    -Status: Assigned
    +Status: Open
    I don't maintain PEAR


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

    [2011-02-20 04:46:36] doconnor

    -Assigned To:
    +Assigned To: saltybeagle


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

    [2011-01-24 22:48:17] christer

    Added #patch
    bug:18218;patch:support_late_static_binding;revision:1295909297;.

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

    [2011-01-24 22:47:44] christer

    Description:
    ------------
    The bug has been previously reported (#17652) but was marked as bogus. I
    added a comment and a patch to that bug report, but will add them again
    here.

    Test script:
    ---------------
    class Autoload {
    static public $classes = array(
    // ...
    );

    static public function load($class) {
    $className = strtolower($class);

    if (isset(static::$classes[$className])) {
    require dirname(__DIR__) . static::$classes[$className];
    }
    }
    }

    Expected result:
    ----------------
    No errors

    Actual result:
    --------------
    If something like the above code is in a PHP script when trying to build
    a package pear will inform you that the file has invalid php code. The
    reason is that the Validator.php class only allows T_WHITESPACE and
    T_STRING in front of the T_DOUBLE_COLON. If you change the source to
    "self::$classes" instead of "static::$classes" pear does not complain.

    ------------------------------------------------------------------------
  • Helgith at Feb 27, 2011 at 3:18 pm
    Edit report at http://pear.php.net/bugs/bug.php?id=18218&edit=1

    ID: 18218
    Updated by: helgith@gmail.com
    Reported By: cogo at starzinger dot net
    Summary: "pear package" does not allow the use of late static
    binding
    Status: Open
    Type: Bug
    Package: PEAR
    Operating System: Linux
    Package Version: 1.9.1
    PHP Version: 5.3.1
    -Assigned To:
    +Assigned To: dufuz
    Roadmap Versions:
    New Comment:

    -Assigned To:
    +Assigned To: dufuz



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

    [2011-02-20 18:31:48] saltybeagle

    -Status: Assigned
    +Status: Open
    I don't maintain PEAR

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

    [2011-02-20 04:46:36] doconnor

    -Assigned To:
    +Assigned To: saltybeagle


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

    [2011-01-24 22:48:17] christer

    Added #patch
    bug:18218;patch:support_late_static_binding;revision:1295909297;.

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

    [2011-01-24 22:47:44] christer

    Description:
    ------------
    The bug has been previously reported (#17652) but was marked as bogus. I
    added a comment and a patch to that bug report, but will add them again
    here.

    Test script:
    ---------------
    class Autoload {
    static public $classes = array(
    // ...
    );

    static public function load($class) {
    $className = strtolower($class);

    if (isset(static::$classes[$className])) {
    require dirname(__DIR__) . static::$classes[$className];
    }
    }
    }

    Expected result:
    ----------------
    No errors

    Actual result:
    --------------
    If something like the above code is in a PHP script when trying to build
    a package pear will inform you that the file has invalid php code. The
    reason is that the Validator.php class only allows T_WHITESPACE and
    T_STRING in front of the T_DOUBLE_COLON. If you change the source to
    "self::$classes" instead of "static::$classes" pear does not complain.

    ------------------------------------------------------------------------
  • Helgith at Feb 27, 2011 at 5:39 pm
    Edit report at http://pear.php.net/bugs/bug.php?id=18218&edit=1

    ID: 18218
    Updated by: helgith@gmail.com
    Reported By: cogo at starzinger dot net
    Summary: "pear package" does not allow the use of late static
    binding
    Status: Assigned
    Type: Bug
    Package: PEAR
    Operating System: Linux
    Package Version: 1.9.1
    PHP Version: 5.3.1
    Assigned To: dufuz
    Roadmap Versions:
    New Comment:

    Can you provide me with exactly the code (a stripped down version is
    fine). I can run
    the code below through the source analyzes function just fine without
    any errors being
    raised.


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

    [2011-02-27 16:21:16] dufuz

    -Assigned To:
    +Assigned To: dufuz


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

    [2011-02-20 18:31:48] saltybeagle

    -Status: Assigned
    +Status: Open
    I don't maintain PEAR

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

    [2011-02-20 04:46:36] doconnor

    -Assigned To:
    +Assigned To: saltybeagle


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

    [2011-01-24 22:48:17] christer

    Added #patch
    bug:18218;patch:support_late_static_binding;revision:1295909297;.

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

    [2011-01-24 22:47:44] christer

    Description:
    ------------
    The bug has been previously reported (#17652) but was marked as bogus. I
    added a comment and a patch to that bug report, but will add them again
    here.

    Test script:
    ---------------
    class Autoload {
    static public $classes = array(
    // ...
    );

    static public function load($class) {
    $className = strtolower($class);

    if (isset(static::$classes[$className])) {
    require dirname(__DIR__) . static::$classes[$className];
    }
    }
    }

    Expected result:
    ----------------
    No errors

    Actual result:
    --------------
    If something like the above code is in a PHP script when trying to build
    a package pear will inform you that the file has invalid php code. The
    reason is that the Validator.php class only allows T_WHITESPACE and
    T_STRING in front of the T_DOUBLE_COLON. If you change the source to
    "self::$classes" instead of "static::$classes" pear does not complain.

    ------------------------------------------------------------------------
  • Cogo at Feb 27, 2011 at 6:05 pm
    Edit report at http://pear.php.net/bugs/bug.php?id=18218&edit=1

    ID: 18218
    Comment by: cogo@starzinger.net
    Reported By: cogo at starzinger dot net
    Summary: "pear package" does not allow the use of late static
    binding
    Status: Assigned
    Type: Bug
    Package: PEAR
    Operating System: Linux
    Package Version: 1.9.1
    PHP Version: 5.3.1
    Assigned To: dufuz
    Roadmap Versions:
    New Comment:

    You can clone a repos of mine from github and run pear package in that
    dir to get the error:

    christer@aurora:~$ git clone
    git://github.com/christeredvartsen/sqldiff.git
    ...
    christer@aurora:~$ cd sqldiff/
    christer@aurora:~/sqldiff$ pear package
    Analyzing SqlDiff/Database/Table/Column/Abstract.php
    ...
    Warning: Parser error: invalid PHP found in file
    "./SqlDiff/Version.php"
    Warning: Parser error: invalid PHP found in file
    "./SqlDiff/Autoload.php"

    I'm getting the Parser error above with PEAR-1.9.1. After applying my
    patch I'm not getting any warnings.


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

    [2011-02-27 18:42:24] dufuz

    Can you provide me with exactly the code (a stripped down version is
    fine). I can run
    the code below through the source analyzes function just fine without
    any errors being
    raised.

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

    [2011-02-27 16:21:16] dufuz

    -Assigned To:
    +Assigned To: dufuz


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

    [2011-02-20 18:31:48] saltybeagle

    -Status: Assigned
    +Status: Open
    I don't maintain PEAR

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

    [2011-02-20 04:46:36] doconnor

    -Assigned To:
    +Assigned To: saltybeagle


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

    [2011-01-24 22:48:17] christer

    Added #patch
    bug:18218;patch:support_late_static_binding;revision:1295909297;.

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

    The remainder of the comments for this report are too long. To view
    the rest of the comments, please view the bug report online at
    http://pear.php.net/bugs/bug.php?id=18218
  • Cogo at Feb 27, 2011 at 6:06 pm
    Edit report at http://pear.php.net/bugs/bug.php?id=18218&edit=1

    ID: 18218
    Comment by: cogo@starzinger.net
    Reported By: cogo at starzinger dot net
    Summary: "pear package" does not allow the use of late static
    binding
    Status: Assigned
    Type: Bug
    Package: PEAR
    Operating System: Linux
    Package Version: 1.9.1
    PHP Version: 5.3.1
    Assigned To: dufuz
    Roadmap Versions:
    New Comment:

    The files that generated parse errors are:

    https://github.com/christeredvartsen/sqldiff/blob/0.0.3/SqlDiff/Autoload.php
    https://github.com/christeredvartsen/sqldiff/blob/0.0.3/SqlDiff/Version.php


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

    [2011-02-27 19:08:18] christer

    You can clone a repos of mine from github and run pear package in that
    dir to get the error:

    christer@aurora:~$ git clone
    git://github.com/christeredvartsen/sqldiff.git
    ...
    christer@aurora:~$ cd sqldiff/
    christer@aurora:~/sqldiff$ pear package
    Analyzing SqlDiff/Database/Table/Column/Abstract.php
    ...
    Warning: Parser error: invalid PHP found in file
    "./SqlDiff/Version.php"
    Warning: Parser error: invalid PHP found in file
    "./SqlDiff/Autoload.php"

    I'm getting the Parser error above with PEAR-1.9.1. After applying my
    patch I'm not getting any warnings.

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

    [2011-02-27 18:42:24] dufuz

    Can you provide me with exactly the code (a stripped down version is
    fine). I can run
    the code below through the source analyzes function just fine without
    any errors being
    raised.

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

    [2011-02-27 16:21:16] dufuz

    -Assigned To:
    +Assigned To: dufuz


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

    [2011-02-20 18:31:48] saltybeagle

    -Status: Assigned
    +Status: Open
    I don't maintain PEAR

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

    [2011-02-20 04:46:36] doconnor

    -Assigned To:
    +Assigned To: saltybeagle


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

    The remainder of the comments for this report are too long. To view
    the rest of the comments, please view the bug report online at
    http://pear.php.net/bugs/bug.php?id=18218
  • Helgith at Feb 27, 2011 at 6:39 pm
    Edit report at http://pear.php.net/bugs/bug.php?id=18218&edit=1

    ID: 18218
    Updated by: helgith@gmail.com
    Reported By: cogo at starzinger dot net
    Summary: "pear package" does not allow the use of late static
    binding
    Status: Assigned
    Type: Bug
    Package: PEAR
    Operating System: Linux
    Package Version: 1.9.1
    PHP Version: 5.3.1
    Assigned To: dufuz
    Roadmap Versions:
    New Comment:

    Interesting, can not get the check function to fail on that code; Will
    have to test it via
    packaging up the code.


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

    [2011-02-27 19:09:28] christer

    The files that generated parse errors are:

    https://github.com/christeredvartsen/sqldiff/blob/0.0.3/SqlDiff/Autoload.php
    https://github.com/christeredvartsen/sqldiff/blob/0.0.3/SqlDiff/Version.php

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

    [2011-02-27 19:08:18] christer

    You can clone a repos of mine from github and run pear package in that
    dir to get the error:

    christer@aurora:~$ git clone
    git://github.com/christeredvartsen/sqldiff.git
    ...
    christer@aurora:~$ cd sqldiff/
    christer@aurora:~/sqldiff$ pear package
    Analyzing SqlDiff/Database/Table/Column/Abstract.php
    ...
    Warning: Parser error: invalid PHP found in file
    "./SqlDiff/Version.php"
    Warning: Parser error: invalid PHP found in file
    "./SqlDiff/Autoload.php"

    I'm getting the Parser error above with PEAR-1.9.1. After applying my
    patch I'm not getting any warnings.

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

    [2011-02-27 18:42:24] dufuz

    Can you provide me with exactly the code (a stripped down version is
    fine). I can run
    the code below through the source analyzes function just fine without
    any errors being
    raised.

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

    [2011-02-27 16:21:16] dufuz

    -Assigned To:
    +Assigned To: dufuz


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

    [2011-02-20 18:31:48] saltybeagle

    -Status: Assigned
    +Status: Open
    I don't maintain PEAR

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

    The remainder of the comments for this report are too long. To view
    the rest of the comments, please view the bug report online at
    http://pear.php.net/bugs/bug.php?id=18218
  • Helgith at Feb 27, 2011 at 6:58 pm
    Edit report at http://pear.php.net/bugs/bug.php?id=18218&edit=1

    ID: 18218
    Updated by: helgith@gmail.com
    Reported By: cogo at starzinger dot net
    Summary: "pear package" does not allow the use of late static
    binding
    -Status: Assigned
    +Status: Closed
    Type: Bug
    Package: PEAR
    Operating System: Linux
    Package Version: 1.9.1
    PHP Version: 5.3.1
    Assigned To: dufuz
    Roadmap Versions:
    New Comment:

    -Status: Assigned
    +Status: Closed
    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.

    Found the issue, test framework was acting up


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

    [2011-02-27 19:42:38] dufuz

    Interesting, can not get the check function to fail on that code; Will
    have to test it via
    packaging up the code.

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

    [2011-02-27 19:09:28] christer

    The files that generated parse errors are:

    https://github.com/christeredvartsen/sqldiff/blob/0.0.3/SqlDiff/Autoload.php
    https://github.com/christeredvartsen/sqldiff/blob/0.0.3/SqlDiff/Version.php

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

    [2011-02-27 19:08:18] christer

    You can clone a repos of mine from github and run pear package in that
    dir to get the error:

    christer@aurora:~$ git clone
    git://github.com/christeredvartsen/sqldiff.git
    ...
    christer@aurora:~$ cd sqldiff/
    christer@aurora:~/sqldiff$ pear package
    Analyzing SqlDiff/Database/Table/Column/Abstract.php
    ...
    Warning: Parser error: invalid PHP found in file
    "./SqlDiff/Version.php"
    Warning: Parser error: invalid PHP found in file
    "./SqlDiff/Autoload.php"

    I'm getting the Parser error above with PEAR-1.9.1. After applying my
    patch I'm not getting any warnings.

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

    [2011-02-27 18:42:24] dufuz

    Can you provide me with exactly the code (a stripped down version is
    fine). I can run
    the code below through the source analyzes function just fine without
    any errors being
    raised.

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

    [2011-02-27 16:21:16] dufuz

    -Assigned To:
    +Assigned To: dufuz


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

    The remainder of the comments for this report are too long. To view
    the rest of the comments, please view the bug report online at
    http://pear.php.net/bugs/bug.php?id=18218

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppear-bugs @
categoriesphp
postedFeb 20, '11 at 3:43a
activeFeb 27, '11 at 6:58p
posts8
users4
websitepear.php.net

People

Translate

site design / logo © 2022 Grokbase