> On Jan 8, 2020, at 05:42, Nikita Popov <nikita....@gmail.com> wrote: > > Hi internals, > > I would like to propose the following RFC, which allows using "static" as a > return type: > > https://wiki.php.net/rfc/static_return_type > > While I'm personally not a fan of late static binding, we do support it and > people do use it quite heavily, so I think we should also support it in > return types. > > Regards, > Nikita
Yes, please! > For the fluent method example above, many projects will use a @return $this > annotation, rather than @return static. In my own code, I usually use `self` to mean “return the same instance.” While I know that, in practice, the use of `self` is identical to using the class name as the return type, it seems natural to designate as practice (among my team) that `self` always means itself and should never refer to an instance with different identity. -Ben
signature.asc
Description: Message signed with OpenPGP