note 63714 added to language.oop.object-comparison

From: Date: Wed, 29 Mar 2006 03:15:32 +0000
Subject: note 63714 added to language.oop.object-comparison
Groups: php.notes 
Request: Send a blank email to php-notes+get-106900@lists.php.net to get a copy of this message
If youre just checking to see if the variables both reference the same object, instead of having a variable set up beforehand you could do away with the GLOBALS and have something like.. e.g. <?php class Foo { var $serial; function Foo() { // Rest of constructor... } // Rest of class definition... } $baz->serial = -1; $bar->serial = time(); if($bar->serial == $baz->serial) { echo "Same"; } ?> ---- Server IP: 84.18.202.180 Probable Submitter: 62.253.128.11 (proxied: 81.111.220.23) ---- X-Spam-Status: No, hits=3.1 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER autolearn=no version=2.64 ---- Manual Page -- http://www.php.net/manual/en/language.oop.object-comparison.php Edit -- http://master.php.net/note/edit/63714 Del: integrated -- http://master.php.net/note/delete/63714/integrated Del: useless -- http://master.php.net/note/delete/63714/useless Del: bad code -- http://master.php.net/note/delete/63714/bad+code Del: spam -- http://master.php.net/note/delete/63714/spam Del: non-english -- http://master.php.net/note/delete/63714/non-english Del: in docs -- http://master.php.net/note/delete/63714/in+docs Del: other reasons-- http://master.php.net/note/delete/63714 Reject -- http://master.php.net/note/reject/63714 Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#106900) next »