note 118961 added to language.namespaces.definitionmultiple

From: Date: Tue, 08 Mar 2016 02:17:27 +0000
Subject: note 118961 added to language.namespaces.definitionmultiple
Groups: php.notes 
Request: Send a blank email to php-notes+get-205114@lists.php.net to get a copy of this message
Notice it's not allowed to mix bracketed namespace with unbracketed namespace declarations. <?php namespace MyTest; const TEST = 777; //in this way echo \MyTest\TEST . '<br />'; //Or this way echo TEST . '<br />'; namespace AnotherTest { const TEST = 555; echo \AnotherTest\TEST . '<br />'; echo \MyTest\TEST; } ?> This code will issue a fatal error, like this: Fatal error: Cannot mix bracketed namespace declarations with unbracketed namespace declarations in C:\xampp\htdocs\teste2.php on line 11. ---- Server IP: 72.52.91.14 Probable Submitter: 201.93.24.102 ---- Manual Page -- http://php.net/manual/en/language.namespaces.definitionmultiple.php Edit -- https://master.php.net/note/edit/118961 Del: integrated -- https://master.php.net/note/delete/118961/integrated Del: useless -- https://master.php.net/note/delete/118961/useless Del: bad code -- https://master.php.net/note/delete/118961/bad+code Del: spam -- https://master.php.net/note/delete/118961/spam Del: non-english -- https://master.php.net/note/delete/118961/non-english Del: in docs -- https://master.php.net/note/delete/118961/in+docs Del: other reasons-- https://master.php.net/note/delete/118961 Reject -- https://master.php.net/note/reject/118961 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#205114) next »