Re: [PHP-DEV] Object comparison

2012-11-09 Thread Nathan Nobbe
On Fri, Nov 9, 2012 at 2:00 PM, jpauli wrote: > On Fri, Nov 9, 2012 at 2:18 PM, Christian Stoller > wrote: > > I would like to place a suggestion for comparing objects (I hope it is > no problem, because this does not have anything to do with Sara's question > - but it came to my mind when I rea

Re: [PHP-DEV] Object comparison

2012-11-09 Thread jpauli
On Fri, Nov 9, 2012 at 2:18 PM, Christian Stoller wrote: > I would like to place a suggestion for comparing objects (I hope it is no > problem, because this does not have anything to do with Sara's question - but > it came to my mind when I read her mail). It would be a great feature if > objec

Re: [PHP-DEV] Object comparison

2012-11-09 Thread Pierre Joye
hi! On Fri, Nov 9, 2012 at 1:07 AM, Sara Golemon wrote: > From: http://php.net/manual/en/language.operators.comparison.php > > An object compared to anything which is not a bool, null, or object > should result in the object appearing to be greater than the other > operand. For example: > > $a =

Re: [PHP-DEV] Object comparison

2012-11-09 Thread Sebastian Krebs
Hi, Maybe it goes way to far, but there is a PECL-extension [1], that allows to overload every(?) operator. However, it seems to be unmaintained for 6 years now and will probably not work anymore, but it may be usable as a starting point. Python provides this too [2] Regards, Sebastian [1] http

RE: [PHP-DEV] Object comparison

2012-11-09 Thread Christian Stoller
I would like to place a suggestion for comparing objects (I hope it is no problem, because this does not have anything to do with Sara's question - but it came to my mind when I read her mail). It would be a great feature if objects could be compared to other objects with ">", "<" and the other

Re: [PHP-DEV] Object comparison

2012-11-09 Thread crankypuss
On 11/08/2012 05:07 PM, Sara Golemon wrote: From: http://php.net/manual/en/language.operators.comparison.php An object compared to anything which is not a bool, null, or object should result in the object appearing to be greater than the other operand. For example: $a = new stdClass(); $b = ne

Re: [PHP-DEV] Object comparison

2012-11-08 Thread Sherif Ramadan
On Thu, Nov 8, 2012 at 7:07 PM, Sara Golemon wrote: > From: http://php.net/manual/en/language.operators.comparison.php > > An object compared to anything which is not a bool, null, or object > should result in the object appearing to be greater than the other > operand. For example: > > $a = new

Re: [PHP-DEV] Object comparison

2012-11-08 Thread Stas Malyshev
Hi! > Doc bug? Or code bug? I'm inclined to call it a code bug, but wanted > others' thoughts. I would say comparing object to a number makes little sense, so no reason to define any specific result there. It may be true, false or bologna sandwich. The docs say what happens when the first parame

Re: [PHP-DEV] Object comparison

2005-07-09 Thread André Luis Ferreira da Silva Bacci
Andrey Hristov wrote: André Luis Ferreira da Silva Bacci wrote: Hi, I was in a discuss about PHP's features vs Python's features these days and gat down in this BC: http://bugs.php.net/bug.php?id=33626 Does it ring any bell to anyone? In PHP4 an object was a value type in PHP5 it is a hand

Re: [PHP-DEV] Object comparison

2005-07-09 Thread Andrey Hristov
André Luis Ferreira da Silva Bacci wrote: Hi, I was in a discuss about PHP's features vs Python's features these days and gat down in this BC: http://bugs.php.net/bug.php?id=33626 Does it ring any bell to anyone? []s André AE In PHP4 an object was a value type in PHP5 it is a handle and

Re: [PHP-DEV] Object comparison bug?

2004-08-31 Thread Derick Rethans
On Tue, 31 Aug 2004, Andi Gutmans wrote: > 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

Re: [PHP-DEV] Object comparison bug?

2004-08-31 Thread Andi Gutmans
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

Re: [PHP-DEV] == object comparison bug?

2004-05-02 Thread Andi Gutmans
Thanks for the detailed report. This should be fixed in the latest CVS. Andi At 01:25 PM 4/28/2004 -0400, Hans Lellelid wrote: I'm using PHP5.0.0RC2. I saw that there was a similar question posted, but apparently that issue had already been fixed. ---code class Fil