Jenis serikat parameter multi -tipe php

#Union types have finally been implemented in PHP 8.0
class Number {
    private int|float $number;

    public function setNumber(int|float $number): void {
        $this->number = $number;
    }

    public function getNumber(): int|float {
        return $this->number;
    }
}
Tiago F2