#47379 [Opn->Bgs]: After defining namespace using curly brace, we can't have any statement then
ID: 47379
Updated by: felipe@php.net
Reported By: vivekanandan8 at yahoo dot com
-Status: Open
+Status: Bogus
Bug Type: *Programming Data Structures
Operating System: debian linux
PHP Version: 5.3.0beta1
New Comment:
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
See:
http://docs.php.net/manual/en/language.namespaces.definitionmultiple.php
Previous Comments:
------------------------------------------------------------------------
[2009-02-13 04:01:50] vivekanandan8 at yahoo dot com
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
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=47379&edit=1
Thread (2 messages)