Answers for "php 8 union types"

PHP
0

php 8 union types

class Number {
  public function __construct(
    private int|float $number
  ) {}
}

new Number('NaN'); // TypeError
Posted by: Guest on February-17-2021

Browse Popular Code Answers by Language