On Sun, 3 Oct 2021 at 07:40, Sebastian Bergmann <sebast...@php.net> wrote: > > Am 02.10.2021 um 16:37 schrieb tyson andre: > > `ReflectionType->allowsValue(mixed $value, bool $strict = true): bool` > > Not having to implement and maintain that functionality in userland would > be brilliant and much appreciated. Right now we have > https://github.com/sebastianbergmann/type for this for use cases related > to test doubles in PHPUnit.
Wow. this package looks powerful. But it also looks like it would require a lot of if/else, switch, or dynamic dispatch, when dealing with those types. E.g. if ($type->isUnion()) ... > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: https://www.php.net/unsub.php > -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php