Object instantiation
| From: | Sam Barrow | Date: | Fri, 18 Apr 2008 16:23:22 +0000 |
| Subject: | Object instantiation | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-37136@lists.php.net to get a copy of this message | ||
I had a question about object instantiation.
You can do this:
function createObject() {
return new myObject;
}
$result = createObject() -> myMethod();
But you can't do this:
$result = new myObject -> myMethod();
Is there a technical reaosn as to why this can't be done? If not can
this be changed?