On Sun, Aug 21, 2016 at 10:28 PM, Dan Ackroyd <dan...@basereality.com> wrote:
> On 21 August 2016 at 20:43, Marco Pivetta <ocram...@gmail.com> wrote: > > > > Sadly, it won't. Here's an example that shows the BC break in a more > > explicit way: > > > > function foo(Iterator $i = null) {} > > var_dump((string) (new ReflectionParameter('foo', 0))->getType()); > > > > This reports `Iterator` for PHP 7.0.x, `?\Iterator` for 7.1.x. > > https://3v4l.org/tDkLj > > > Thanks. > > I missed that part - I thought this was just about ?types, not things > that have default of null. > > cheers > Dan > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > Hi. Now that we have made ReflectionType::__toString() be useless and not represent the type, this method should be deprecated in favor of using ReflectionNamedType::__toString(), ::allowsNull() and any further extensions that will be introduced later. I recommend doing this swiftly so as to ensure that people do not use this method on PHP 7.1 anymore and thus avoid pain on future upgrades. Nikita