note 112319 deleted from language.namespaces.definition by cmb
| From: | cmb@php.net | Date: | Thu, 03 Sep 2015 10:21:20 +0000 |
| Subject: | note 112319 deleted from language.namespaces.definition by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-203611@lists.php.net to get a copy of this message | ||
Note Submitter: wyattbiker
----
<?php
//Even though you cant add anything before the 1st namespace, you can add something before
subsequent namespaces.
namespace MyProject;
function myfunc(){
return 1;
}
echo myfunc();
?>
<p>Here I can add stuff before the 2nd namespace</p>
<?php
namespace MyProject2;
function myfunc(){
return 2;
}
echo myfunc();
?>
<p>Switch back to first namespace</p>
<?php
namespace MyProject;
echo myfunc();
?>