Re: Unified ReflectionType methods

From: Date: Sun, 03 Oct 2021 06:23:38 +0000
Subject: Re: Unified ReflectionType methods
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to internals+get-116191@lists.php.net to get a copy of this message
On Sun, 3 Oct 2021 at 07:40, Sebastian Bergmann <sebastian@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 >

« previous php.internals (#116191) next »