On Sun, Aug 11, 2019 at 3:44 AM Nikita Popov <nikita....@gmail.com> wrote:
> What do you think about this? As we are currently annotating everything > with types, and we're at a major version, this would be the ideal time to > make this change. But there's certainly a BC break here. (And, for the > record, this is not the type of BC break where P++ or editions help, > without creating a larger mess.) > > I think your original proposal was spot on. It added to the language without creating any BC breaks. The ideal outcome. This modification adds an admittedly small BC break for an equally small benefit. -1 from me. -Sara P.S. - Perhaps a way to the middle might be to introduce implicit return type hints. If a child method is implemented with no return type specified on a parent method which has one, then the parent's type is assumed at bind time, then we provide a better runtime error if that assumption is violated in a strict_types=1 context which is the only place where strict covariance of return types matters to PHP.