note 109455 added to language.namespaces.nested
| From: | ant92083 | Date: | Wed, 18 Jul 2012 18:53:40 +0000 |
| Subject: | note 109455 added to language.namespaces.nested | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-189289@lists.php.net to get a copy of this message | ||
You may not be able to add variables to be evaulated to namespaces but you can use them in the
creation of classes.
$subClass = 'Toast';
$cacheClass = '\Foo\Bar\Baz\\' . $subClass;
This will instantiate a class of in the subspace of \Foo\Bar\Baz
----
Server IP: 64.71.164.2
Probable Submitter: 68.165.143.98
----
Manual Page -- http://www.php.net/manual/en/language.namespaces.nested.php
Edit -- https://master.php.net/note/edit/109455
Del: integrated -- https://master.php.net/note/delete/109455/integrated
Del: useless -- https://master.php.net/note/delete/109455/useless
Del: bad code -- https://master.php.net/note/delete/109455/bad+code
Del: spam -- https://master.php.net/note/delete/109455/spam
Del: non-english -- https://master.php.net/note/delete/109455/non-english
Del: in docs -- https://master.php.net/note/delete/109455/in+docs
Del: other reasons-- https://master.php.net/note/delete/109455
Reject -- https://master.php.net/note/reject/109455
Search -- https://master.php.net/manage/user-notes.php