Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:12516 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 51513 invoked by uid 1010); 1 Sep 2004 05:02:16 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 51331 invoked from network); 1 Sep 2004 05:02:14 -0000 Received: from unknown (HELO mail.zend.com) (80.74.107.235) by pb1.pair.com with SMTP; 1 Sep 2004 05:02:14 -0000 Received: (qmail 10159 invoked from network); 1 Sep 2004 05:02:08 -0000 Received: from localhost (HELO AndiNotebook.zend.com) (127.0.0.1) by localhost with SMTP; 1 Sep 2004 05:02:08 -0000 Message-ID: <5.1.0.14.2.20040831215959.02ea8e70@127.0.0.1> X-Sender: andi@127.0.0.1 X-Mailer: QUALCOMM Windows Eudora Version 5.1 Date: Tue, 31 Aug 2004 22:01:46 -0700 To: Christian Stocker ,PHPdev In-Reply-To: <41346C5A.7060704@bitflux.ch> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed Subject: Re: [PHP-DEV] Object comparison bug? From: andi@zend.com (Andi Gutmans) References: <41346C5A.7060704@bitflux.ch> Hi Christian, This was a backwards compatibility issue and therefore, we made sure that PHP 5 behaves the same way as PHP 4. So if both objects are PHP objects it will do a PHP 4 object comparison. If you use === (is identical) then we will only compare handles unless in zend1.compatibility_mode. This should give people the best of both worlds being able to choose comparison (==) or strict identical (===). Andi At 02:17 PM 8/31/2004 +0200, Christian Stocker wrote: >Hi > >The following came up in a bug report (http://bugs.php.net/?id=29911 , but >it doesn't matter, as he tried something which doesn't work either way) > >class foo {}; >$foo1 = new foo(); >$foo2 = new foo(); >var_dump($foo1 == $foo2); >?> > >prints now true, but according to Derick and >http://talks.php.net/show/migrating-ffm/8 it should print false in PHP 5 > >Bug or expected behaviour? > >(I don't care much, since I wouldn't compare objects that way in the first >place ;) ) > >chregu > > >-- >christian stocker | Bitflux GmbH | schoeneggstrasse 5 | ch-8004 zurich >phone +41 1 240 56 70 | mobile +41 76 561 88 60 | fax +41 1 240 56 71 >http://www.bitflux.ch | chregu@bitflux.ch | gnupg-keyid 0x5CE1DECB > >-- >PHP Internals - PHP Runtime Development Mailing List >To unsubscribe, visit: http://www.php.net/unsub.php