note 42636 added to language.oop
| From: | Dave at rn2 dot php dot net | Date: | Mon, 24 May 2004 19:00:15 +0000 |
| Subject: | note 42636 added to language.oop | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-70037@lists.php.net to get a copy of this message | ||
Check out the following code:
class A {
function foo() {}
}
function getA() {return new A;}
getA()->foo();
I'm using PHP 4 and it doesn't allow me to call functions on objects returned by any kind
of function. Is this changed in PHP 5? Is there any way around this? This stinks because it makes
using accessor functions that return objects annoying to use in certain cases (you have to
temporarily store the return value in the above case).
----
Manual Page -- http://www.php.net/manual/en/language.oop.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+42636
Delete -- http://master.php.net/manage/user-notes.php?action=delete+42636&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+42636&report=yes
Search -- http://master.php.net/manage/user-notes.php