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 =

RE: [PHP-DEV] Object comparison

2012-11-09 Thread Christian Stoller
...@golemon.com] On Behalf Of Sara Golemon Sent: Friday, November 09, 2012 1:07 AM To: PHP internals Subject: [PHP-DEV] Object comparison 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

Re: [PHP-DEV] Object comparison

2012-11-09 Thread Sebastian Krebs
be made usable for userland classes/objects, too. Best regards Christian Stoller -Original Message- From: p...@golemon.com [mailto:p...@golemon.com] On Behalf Of Sara Golemon Sent: Friday, November 09, 2012 1:07 AM To: PHP internals Subject: [PHP-DEV] Object comparison From

Re: [PHP-DEV] Object comparison

2012-11-09 Thread Pierre Joye
hi! On Fri, Nov 9, 2012 at 1:07 AM, Sara Golemon poll...@php.net 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

Re: [PHP-DEV] Object comparison

2012-11-09 Thread jpauli
On Fri, Nov 9, 2012 at 2:18 PM, Christian Stoller stol...@leonex.de 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

Re: [PHP-DEV] Object comparison

2012-11-09 Thread Nathan Nobbe
On Fri, Nov 9, 2012 at 2:00 PM, jpauli jpa...@php.net wrote: On Fri, Nov 9, 2012 at 2:18 PM, Christian Stoller stol...@leonex.de 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

[PHP-DEV] Object comparison

2012-11-08 Thread Sara Golemon
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 = new stdClass(); var_dump(null $a);

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

Re: [PHP-DEV] Object comparison

2012-11-08 Thread Sherif Ramadan
On Thu, Nov 8, 2012 at 7:07 PM, Sara Golemon poll...@php.net 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:

[PHP-DEV] Object comparison

2005-07-09 Thread André Luis Ferreira da Silva Bacci
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 -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit:

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

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

Re: [PHP-DEV] Object comparison bug?

2004-09-01 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

[PHP-DEV] Object comparison bug?

2004-08-31 Thread Christian Stocker
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) ?php class foo {}; $foo1 = new foo(); $foo2 = new foo(); var_dump($foo1 == $foo2); ? prints now true, but according to Derick and

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

[PHP-DEV] == object comparison bug?

2004-04-28 Thread Hans Lellelid
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 File { public $var; function __construct($val) { $this-var = $val; } } $t1 = new