3v4l.org

run code in 300+ PHP versions simultaneously
<?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')));

preferences:
30.88 ms | 402 KiB | 5 Q