note 78438 added to language.oop5
| From: | hyponiq at gmail dot com | Date: | Fri, 12 Oct 2007 02:53:10 +0000 |
| Subject: | note 78438 added to language.oop5 | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-131325@lists.php.net to get a copy of this message | ||
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.";
}
}
}
----
Server IP: 69.147.83.197
Probable Submitter: 24.159.187.86
----
Manual Page -- http://www.php.net/manual/en/language.oop5.php
Edit -- https://master.php.net/note/edit/78438
Del: integrated -- https://master.php.net/note/delete/78438/integrated
Del: useless -- https://master.php.net/note/delete/78438/useless
Del: bad code -- https://master.php.net/note/delete/78438/bad+code
Del: spam -- https://master.php.net/note/delete/78438/spam
Del: non-english -- https://master.php.net/note/delete/78438/non-english
Del: in docs -- https://master.php.net/note/delete/78438/in+docs
Del: other reasons-- https://master.php.net/note/delete/78438
Reject -- https://master.php.net/note/reject/78438
Search -- https://master.php.net/manage/user-notes.php