ID:               28219
 Updated by:       [EMAIL PROTECTED]
 Reported By:      hans at velum dot net
-Status:           Open
+Status:           Bogus
 Bug Type:         Zend Engine 2 problem
 Operating System: Linux
 PHP Version:      5.0.0RC2
 New Comment:

Duplicate of bug #28165. Please search the database before filing a
bug.


Previous Comments:
------------------------------------------------------------------------

[2004-04-29 18:38:20] hans at velum dot net

Description:
------------
I get 

Notice: Object of class File could not be converted to integer

when trying to compare object contents using '==' comparison operator. 
Comparing the actual reference using === works, but obviously means
something different.

Reproduce code:
---------------
class File {
    public $var;
    function __construct($val) {
        $this->var = $val;
    }
}

$t1 = new File("test");
$t2 = new File("test");

print_r($t1);
print_r($t2);

print "\$t1 == \$t2 ?";
if ($t1 == $t2) {
    print "YES\n";
} else {
    print "NO\n";
} 

Expected result:
----------------
File Object
(
    [var] => test
)
File Object
(
    [var] => test
)
$t1 == $t2 ? YES 

Actual result:
--------------
File Object
(
    [var] => test
)
File Object
(
    [var] => test
)
$t1 == $t2 ?
Notice: Object of class File could not be converted to integer in
/var/www/apps/ddi/test.php on line 18

Notice: Object of class File could not be converted to integer in
/var/www/apps/ddi/test.php on line 18
YES 


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=28219&edit=1

Reply via email to