Good morning, On Wed, Jul 28, 2021 at 5:52 AM Rowan Tommins <rowan.coll...@gmail.com> wrote: > > On 27 July 2021 21:29:47 BST, "André Hänsel" <an...@webkr.de> wrote: > >> In fact, when 7.1 was released, none of the signatures changed in my > >code, they were just > >> updated to a different syntax. > > > >That by the way is only because of a specific compatibility behavior > >which is so confusing > >that I erroneously reported it as a bug: > >https://bugs.php.net/bug.php?id=80948 > > > I can see how it would be confusing if you're coming to PHP fresh in the last > few years, but from version 5.1 though to version 7.0, that was the way you > marked nullable parameter types. > > It's a "compatibility behavior" only in the sense that it wasn't immediately > removed when the more flexible "?type" syntax was added in 7.1.
I get the feeling the nullable type syntax was not very well noticed by users when it came out. However it is not what is confusing I think. intersection, types on the other hand, are. I have yet to find usages so critical that we had to rush that in in an incomplete manner. I personally prefer how it is done in typescript, but same thought, I have yet to see good code design using them. ;) Best, -- Pierre @pierrejoye | http://www.libgd.org -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php