ID: 43343
Updated by: [EMAIL PROTECTED]
Reported By: felipensp at gmail dot com
-Status: Assigned
+Status: Closed
Bug Type: Scripting Engine problem
PHP Version: 5.3CVS-2007-11-20 (snap)
Assigned To: dmitry
New Comment:
The syntax A::$foo assumes static property of class A.
The syntax namespace::$foo makes no sense as namespaces cannot contain
variables.
The current version emits error message:
Fatal error: Cannot use 'namespace' as a class name
Previous Comments:
------------------------------------------------------------------------
[2007-11-24 12:31:48] [EMAIL PROTECTED]
Another namespace issue.
------------------------------------------------------------------------
[2007-11-20 11:01:13] felipensp at gmail dot com
Description:
------------
See the code below.
Reproduce code:
---------------
<?php
namespace foobar;
class foo { }
//var_dump(namespace::);
// Parse error: syntax error, unexpected ')', expecting T_STRING or
T_VARIABLE or '$'
// Ok!
$foo = 'foo';
var_dump(new namespace::$foo);
// Fatal error: Class 'foobar' not found
// var_dump(new namespace::foo); # Ok!
Expected result:
----------------
var_dump(namespace::);
Parse error: syntax error, unexpected ')', expecting T_STRING
or
Support the variable referencing class name.
Actual result:
--------------
Fatal error: Class 'foobar' not found
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=43343&edit=1