#44782 [NEW]: Problem with namespace / late static binding
| From: | deleet at sapo dot pt | Date: | Sat, 19 Apr 2008 18:34:31 +0000 |
| Subject: | #44782 [NEW]: Problem with namespace / late static binding | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-124375@lists.php.net to get a copy of this message | ||
From: deleet at sapo dot pt
Operating system: Fedora 6
PHP version: 5.3CVS-2008-04-19 (snap)
PHP Bug Type: Class/Object related
Bug description: Problem with namespace / late static binding
Description:
------------
Possible problem with the implementation of namespaces and late static
binding.
Reproduce code:
---------------
<?php
namespace Something;
class Testing {
function __construct() {
}
static function stuff() {
echo 'I work!' . "<br />\n";
}
}
Testing::stuff();
$var = 'Testing'; $func = 'stuff';
// No effect: use Something;
$var::$func();
?>
Expected result:
----------------
Output:
------------------
I work!
I work!
Actual result:
--------------
Output:
------------------
I work!
Fatal error: Class 'Testing' not found in //file url// on line 20
------------------
PHP is not looking for the class inside the defined namespace when using
late static binding. It works if I use $var = 'Something::Testing'; but
that's not indented behaviour. Also, using the namespace seems to have no
effect.
--
Edit bug report at http://bugs.php.net/?id=44782&edit=1
--
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=44782&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=44782&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=44782&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=44782&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=44782&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=44782&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=44782&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=44782&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=44782&r=support
Expected behavior: http://bugs.php.net/fix.php?id=44782&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=44782&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=44782&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=44782&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=44782&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=44782&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=44782&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=44782&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=44782&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=44782&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=44782&r=mysqlcfg