Bug #18125: Cannot use :: operator when defining child classes

From: Date: Wed, 03 Jul 2002 03:41:11 +0000
Subject: Bug #18125: Cannot use :: operator when defining child classes
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-12920@lists.php.net to get a copy of this message
From: optikSmoke@subdimension.com Operating system: Linux 2.4.18 (RedHat 7.3) PHP version: 4.0CVS-2002-07-02 PHP Bug Type: Zend Engine 2 problem Bug description: Cannot use :: operator when defining child classes Essentially, I have run into this problem: I am unable to use the '::' operator to define a class within a namespace or inherit from a class within another namespace (I am using 4.3.0-alpha2). Example: <? class Boo { class Scream { } } class Boo::Ahh extends Boo::Scream { } ?> This will generate a "expecting ''{'' on line 7" parser error (the "class Boo::Ahh ....." line). Similarly, "class Biff extends Boo::Scream {}" and "class Biff::Ahh extends Boo {}" (or any other definitions in these forms) will generate the same error. It appears to me that any class definitions that use the :: operator and the extends clause will generate this error. I have found this to be a problem that is particularly annoying, as I am developing a set of library classes that reside within specific namespaces, in seperate files. For example, I would like to be able to create a namespace "Foo" containing class "Bar" and its child class "Biff", both in seperate files so scripts not utililizing "Biff" need not load it. -- Edit bug report at http://bugs.php.net/?id=18125&edit=1 -- Fixed in CVS: http://bugs.php.net/fix.php?id=18125&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=18125&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=18125&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=18125&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=18125&r=support Expected behavior: http://bugs.php.net/fix.php?id=18125&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=18125&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=18125&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=18125&r=globals

« previous php.bugs (#12920) next »