note 30941 added to language.references.arent

From: Date: Thu, 03 Apr 2003 22:51:37 +0000
Subject: note 30941 added to language.references.arent
Groups: php.notes 
Request: Send a blank email to php-notes+get-46194@lists.php.net to get a copy of this message
I solved the equalitiy problem by giving every object a unique ID: $objectID = 0; class SuperObject { var $objectID; function SuperObject() { $this->constructor(); } function constructor() { $this->objectID = ($GLOBALS["objectID"]++); } function getObjectID() { return $this->objectID; } function equals(&$otherObject) { return $this->objectID==$otherObject->getObjectID(); } } class AnyObject extends SuperObject { function AnyObject() { parent::constructor(); } } -- http://www.php.net/manual/en/language.references.arent.php http://master.php.net/manage/user-notes.php?action=edit+30941 http://master.php.net/manage/user-notes.php?action=delete+30941 http://master.php.net/manage/user-notes.php?action=reject+30941

« previous php.notes (#46194) next »