Re: [RFC] [DISCUSSION] Allow void return type for constructors/destructors
| From: | Máté Kocsis | Date: | Wed, 17 Jun 2020 08:31:34 +0000 |
| Subject: | Re: [RFC] [DISCUSSION] Allow void return type for constructors/destructors | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-110619@lists.php.net to get a copy of this message | ||
>
> This PR should also address all of Máté's concerns since it makes
> constructors and destructors always return
void (even when no
> explicit
> void return type is specified).
To be clear, my main concern was that declaring a void return type
shouldn't be
allowed, unless it's actually enforced. Now, it's all fine because you
stated your
intentions :)
However, I am also fine if the void return value is only enforced when the
void return
type is declared. Additionally, we could emit a deprecation notice/warning
when
there is no return type declaration, but a value is returned. I think this
would be
a nice way to immediately give people the possibility to disallow a return
value,
while being respectful for older code bases.
Regards,
Máté