A
Size: a a a
A
R
А
R
ПУ
PB
AP
ЕП
А
А
R
PB
ЕП
PB
ЕП
PB
PB
V
class Entity
{
protected $a;
public function __construct($a)
{
$this->a = $a;
}
public function isEquals(Entity $self)
{
return $this->getObjectVars() === $self->getObjectVars();
}
private function getObjectVars()
{
return get_object_vars($this);
}
}
$entity = new Entity(1);
$entity4 = new Entity(2);
echo (int)$entity->isEquals($entity4);
V
MM
$self
это обычная переменная