note 22520 added to language.oop
| From: | michael at hollinger dot net | Date: | Thu, 20 Jun 2002 20:26:21 +0000 |
| Subject: | note 22520 added to language.oop | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-32058@lists.php.net to get a copy of this message | ||
I'm working with a couple of different types of objects.
On a whim, I tried to execute this code as the ctor for a class:
function db_user($serial)
{
$temp=new db_query("SELECT <STUFF>");
$this=$temp->get_result();
$temp->free_result();
}
Can someone please explain to me why the '$this->..." line works, and if it's
supposed to work this way? When I execute that code, all existing methods and members of the class
are erased, and replaced with the ones from the rh side of the assignment. However, the function
still continues to execute.
Neat feature, or odd quirk? Will this behavior change in future versions of PHP?
--
http://www.php.net/manual/en/language.oop.php
http://master.php.net/manage/user-notes.php?action=edit+22520
http://master.php.net/manage/user-notes.php?action=delete+22520
http://master.php.net/manage/user-notes.php?action=reject+22520