From:             ben at pirionsystems dot com dot au
Operating system: Windows XP
PHP version:      5CVS-2003-03-02 (dev)
PHP Bug Type:     Zend Engine 2 problem
Bug description:  Problem referencing static var of class inside a namespace

Hi!

I've found an odd problem that looks like just a problem with the parser
syntax.  The following example will show it:

<?php

namespace Test:Test2 {
class Test3 {
static $blah = "qwerty";
}
}

// this works as expected by printing out "qwerty";
print "Test:Test2::Test3::\$blah: ".Test:Test2::Test3::$blah."<br>\n";


namespace Test4 {
class Test5 {
static $blah = "asdf";
}
}

// this causes a parse error: unexpected T_PAAMAYIM_NEKUDOTAYIM
print "Test4::Test5::\$blah: ".Test4::Test5::$blah."<br>\n";

?>

So, if the namespace name has a : in it, then you can reference variables
within a class contained within the namespace, otherwise you can't. So,
assuming that the : doesn't do anything special, it looks like a problem
with the flex/yacc/whatever it is parser and the engine should cope with
it.

I think that's everything.

Ben
-- 
Edit bug report at http://bugs.php.net/?id=22501&edit=1
-- 
Try a CVS snapshot:         http://bugs.php.net/fix.php?id=22501&r=trysnapshot
Fixed in CVS:               http://bugs.php.net/fix.php?id=22501&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=22501&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=22501&r=needtrace
Try newer version:          http://bugs.php.net/fix.php?id=22501&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=22501&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=22501&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=22501&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=22501&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=22501&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=22501&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=22501&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=22501&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=22501&r=gnused

Reply via email to