Re: [RFC] Never For Argument Types

From: Date: Sat, 14 Aug 2021 17:21:18 +0000
Subject: Re: [RFC] Never For Argument Types
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to internals+get-115730@lists.php.net to get a copy of this message
On Sat, Aug 14, 2021 at 10:12 AM Claude Pache <claude.pache@gmail.com> wrote: > > If users of that interface would suddenly be *required* to specify a > parameter type, whereas previously they were *forbidden* to specify one, > except a meaningless mixed... it would be not nice and useless. > > Moreover, note that mixed was only introduced very recently, in > 8.0: so > that, it would be impossible to implement ArrayAccess on code > that work > both in 7.x and a future version with the updated interface. Not only would > it be not nice, but it would be positively harmful. > > Those are some excellent points I hadn't considered. I will remove the explicit widening from this RFC and update my pull request. I was considering having that aspect as a separate vote, but this point about mixed being a recent addition was a point I hadn't considered, and to me suggests that it shouldn't even be an option in the RFC, particularly because we would like to update the ArrayAccess interface and that will affect a lot of existing code. Jordan

« previous php.internals (#115730) next »