Nope, that isn't changing.

I simply wanted to point out that this RFC is proposing to allow to declare
constructor return type as `: void`, but not as `: mixed`.

The entire RFC is just a matter of cosmetic addition allowing to add `:
void` to constructors/destructors (for those that want to).

It seems that I will have to rewrite the BC section to be more clear on
that.

Best regards,
Benas

On Tue, Jun 16, 2020, 5:36 PM Christoph M. Becker <cmbecke...@gmx.de> wrote:

> On 16.06.2020 at 16:19, Benas IML wrote:
>
> > I meant something like this:
> > ```
> > <?php
> > class Test {
> >     public function __construct() {}
> > }
> >
> > class Test2 extends Test {
> >     /* this is legal */
> >     public function __construct(): void {}
> > }
> >
> > class Test3 extends Test {
> >     /*
> >      * this is illegal, even though no
> >      * return type means mixed|void
> >      */
> >     public function __construct(): mixed {}
> > }
> >
> > class Test4 extends Test2 {
> >     /*
> >      * this is legal, even though we are
> >      * widening void type to mixed|void
> >      * but LSP checks don't apply to
> >      * constructors and destructors
> >      */
> >     public function __construct() {}
> > }
> > ```
>
> Currently, constructors are exempt from LSP checks[1]; are you planning
> to change that?
>
> [1] <https://3v4l.org/PeDCY>
>
> --
> Christoph M. Becker
>

Reply via email to