| 1 | <?php |
||
| 5 | class Hex |
||
| 6 | { |
||
| 7 | /** @var int|null */ |
||
| 8 | protected $max; |
||
| 9 | |||
| 10 | /** |
||
| 11 | * @param int|null $max |
||
| 12 | */ |
||
| 13 | 3 | public function __construct(int $max = null) |
|
| 17 | |||
| 18 | /** |
||
| 19 | * @param $subject |
||
| 20 | * @param $field |
||
| 21 | * |
||
| 22 | * @return bool |
||
| 23 | */ |
||
| 24 | 3 | public function __invoke($subject, string $field): bool |
|
| 45 | } |
||
| 46 |
In PHP, under loose comparison (like
==, or!=, orswitchconditions), values of different types might be equal.For
integervalues, zero is a special case, in particular the following results might be unexpected: