mirror of
https://github.com/php/php-src.git
synced 2024-12-14 20:33:36 +08:00
7e8e21df0c
std_compare_objects immidiately returned 0 if the property tables of both objects contain NULL at some index. Thus it would report objects as equal even though properties following after that differ.
27 lines
499 B
PHP
27 lines
499 B
PHP
--TEST--
|
|
Bug #66286: Incorrect object comparison with inheritance
|
|
--FILE--
|
|
<?php
|
|
|
|
abstract class first {
|
|
protected $someArray = array();
|
|
}
|
|
|
|
class second extends first {
|
|
protected $someArray = array();
|
|
protected $someValue = null;
|
|
|
|
public function __construct($someValue) {
|
|
$this->someValue = $someValue;
|
|
}
|
|
}
|
|
|
|
$objFirst = new second('123');
|
|
$objSecond = new second('321');
|
|
|
|
var_dump ($objFirst == $objSecond);
|
|
|
|
?>
|
|
--EXPECT--
|
|
bool(false)
|