hi Mirco,



On Mon, Feb 23, 2026, 11:00 PM Mirco Babin <[email protected]> wrote:

> Hello Pierre,
>
> Op vr 20 feb 2026 om 19:29 schreef Pierre Joye <[email protected]>:
> >
> > Hello Mirco,
> >
>
> > In a context of __construct, disallow any return value can be detected
> > as well. Any return statement with anything used with it can be
> > rejected (and should).
> >
> > It is documented as void, we could "fix" it with a bug fix.
>
> - https://www.php.net/manual/en/language.oop5.decon.php#object.construct
>   lists the __construct() function as void.
> - But the implementation of __construct() is mixed.
>
> l
>



see https://www.php.net/manual/en/language.oop5.decon.php

__construct(mixed <https://www.php.net/manual/en/language.types.mixed.php>
...$values = ""): void
<https://www.php.net/manual/en/language.types.void.php>


> I have found https://php-legacy-docs.zend.com/manual/php4/en/migration5.
> But I didn't find any specific __construct() instructions, other than
> https://php-legacy-docs.zend.com/manual/php4/en/language.oop5.decon. At
> that page, it is not mentioned the __construct() must not return a value.
>

it should I think, maybe it was not done for bc or avoid breaking codes,
but it was years ago.


> Could you explain on serialization or hydration challenges in more
> details? Perhaps with a theoretical example?
> An (old) real-world example would be even better, if you can find one.
>

Sorry, i do not have the time to look. Try to google a bit, quite a lot of
old bugs in various projects about that.

Best,

>

Reply via email to