note 111497 deleted from language.namespaces.definitionmultiple by danbrown
| From: | danbrown@php.net | Date: | Mon, 04 Mar 2013 17:50:04 +0000 |
| Subject: | note 111497 deleted from language.namespaces.definitionmultiple by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-193831@lists.php.net to get a copy of this message | ||
Note Submitter: rwn dot gallego at gmail dot com
----
If I do what kothnok at gmail dot com says, I get this error:
PHP Fatal error: Cannot mix bracketed namespace declarations with unbracketed namespace
declarations
So, I was able to do this without problems:
<?php
namespace ZCE\People{
class Nurse{
public function __construct(){
echo "Object created!\n";
}
}
function get(){ return "get() called!\n"; }
}
namespace ZCE\Furnitures{
use ZCE\People\Nurse as NUR;
use ZCE\People; // <----- Look at the use statements inside brackets
$nurse = new NUR();
echo People\get();
}
And this worked!