note 78438 deleted from language.oop5 by felipe
| From: | felipe@php.net | Date: | Mon, 24 Dec 2007 02:57:34 +0000 |
| Subject: | note 78438 deleted from language.oop5 by felipe | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-133960@lists.php.net to get a copy of this message | ||
Note Submitter: hyponiq at gmail dot com
----
You know, it would be rather nice to have something like:
namespace SomeClassContainer
{
class MyClass1
{
class MyClass1ChildClass
{
function __construct()
{
print "I will print when " . __CLASS__ . " is instanciated, but will only work if
" . parent . " is instanciated, also.\n";
print "The syntax would be something like this:\n";
print ' $ns = SomeClassContainer;' . "\n";
print ' $myClass1 = new $ns->MyClass1();' . "\n";
print ' $mySubClass1 = new $myClass1->MyClass1ChildClass();' . "\n";
print "--OR--\n";
print ' $mySubClass1 = new SomeClassContainer::MyClass1::MyClass1ChildClass();' .
"\n";
}
}
function __construct()
{
print "I will print when " . __CLASS__ . " is instanciated.";
}
}
}