note 30941 deleted from language.references.arent by sniper
| From: | sniper@php.net | Date: | Tue, 30 Sep 2003 01:22:45 +0000 |
| Subject: | note 30941 deleted from language.references.arent by sniper | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-57331@lists.php.net to get a copy of this message | ||
Note Submitter: markus@malkusch.de
----
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();
}
}