|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2009-10-24 02:00 UTC] johannes@php.net
[2009-10-24 18:44 UTC] swquinn at gmail dot com
[2009-10-24 18:49 UTC] swquinn at gmail dot com
[2009-10-31 14:15 UTC] kalle@php.net
[2009-11-13 19:42 UTC] vrana@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 08:00:01 2025 UTC |
Description: ------------ Using a PHP language token, or syntactic keyword within a namespace causes a Parse error to be thrown by PHP. There is no documentation anywhere (that I could find) indicating whether keywords are permitted as part of a namespace name. If they are not, it would be nice if this is documented. If they should be, then this is clearly a defect. It would be _nice_ a keyword could contain any words (language syntax or otherwise). Reproduce code: --------------- <?php namespace my\default\ns; class Foo { public function bar() { return 0; } } $foo = new Foo(); echo $foo->bar(); ?> Expected result: ---------------- 0 Actual result: -------------- Parse error: syntax error, unexpected T_DEFAULT, expecting T_STRING in D:\PHP\tests\test.php on line 2