note 111545 deleted from language.namespaces.definitionmultiple by danbrown
| From: | danbrown@php.net | Date: | Mon, 04 Mar 2013 17:40:53 +0000 |
| Subject: | note 111545 deleted from language.namespaces.definitionmultiple by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-193804@lists.php.net to get a copy of this message | ||
Note Submitter: postkonto at gmx dot de
----
Should be confusing what
rwn dot gallego at gmail dot com
and
kothnok at gmail dot com
meant.
E.g., this won't work with declared global namespace in the same file as this won't allow
semicolon and (!) brackets.
To keep syntax actually it would be:
<?php
namespace foo\bar
{
class myClass{
function myTest(){
echo "test";
}
}
}
namespace another\bar
{
use \foo\bar\myClass; // pay attention to leading backslash even if "subnamespace
syntax" works
$a = new myClass();
$a->myTest();
// or
$a = new \foo\bar\myClass(); // again leading backslash as only this works
$a->myTest();
}
?>