note 118962 deleted from language.namespaces.definitionmultiple by cmb

From: Date: Mon, 19 Oct 2020 15:35:24 +0000
Subject: note 118962 deleted from language.namespaces.definitionmultiple by cmb
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-215616@lists.php.net to get a copy of this message
Note Submitter: maycon dot rodrigues1 at gmail dot com ---- 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.

« previous php.notes (#215616) next »