3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php final class Money { public function __construct(int $amount, $currency) { $this->amount = $amount; $this->currency = $currency; } public function equals(Money $otherMoney) { return $this->amount === $otherMoney->amount && $this->currency === $otherMoney->currency; } } $moneyOne = new Money(100, 'EUR'); var_dump($moneyOne->equals(new Money(100, 'ISK')));
Output for 7.0.0 - 7.2.6
bool(false)
Output for 5.3.20 - 5.6.28
Catchable fatal error: Argument 1 passed to Money::__construct() must be an instance of int, integer given, called in /in/qOLbF on line 18 and defined in /in/qOLbF on line 5
Process exited with code 255.