|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2009-02-13 21:15 UTC] felipe@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Nov 02 05:00:01 2025 UTC |
Description: ------------ when defining the namespace using the curly brace,no statement can't be accepted after the end of namespace,hence we are forced to use in the separate include file. where as other format of defining namespace like namsespace a; works fine. Reproduce code: --------------- <?php namespace nsUserInfo { const vRole = 'user'; } print "Expected Result :". \nsUserInfo\vRole; ?> Expected result: ---------------- Expected Result :user Actual result: -------------- Fatal error: No code may exist outside of namespace {} in /usr/local/apache/htdocs/php/nstest.php on line 7