Union Types: X|Y

(Pure) Intersection Types: X&Y

Disjunctive Normal Form Types: (X&A)|(Y&B)


class Foreachy {
    private *array|(Traversable&Countable)* $foreachableData;
 
    public function setIterator(*array|(Traversable&Countable)* $foreachable): void {
        $this->foreachableData = $foreachable;
    }
 
    public function getIterator(): *array|(Traversable&Countable)* {
        return $this->foreachableData;
    }
}