3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Money { private $amount; public function __construct($amount) { $this->amount = $amount; } public function equals(Money $otherMoney) { return $this->amount === $otherMoney->amount; } } class MonopolyMoney extends Money { } $a = new Money(1); $b = new MonopolyMoney(1); var_dump($a->equals($b)); echo ($a->amount === 1);
based on ejotY