Open
Description
Rough draft:
// Type checks, already possible today
$value is int;
// Literal checks
$value is 1;
// Omitting values
$value is [, $second];
// Deconstruction
$value is Person(name: $name);
See also:
- Pattern matching iluuu1994/php-src#102
- Pattern matching Kotlin/KEEP#213
- https://openjdk.org/jeps/441 (including "Future work" section)