Re: Return type declaration and &return.falseforfailure;
| From: | Levi Morrison | Date: | Mon, 12 Feb 2018 14:55:23 +0000 |
| Subject: | Re: Return type declaration and &return.falseforfailure; | ||
| References: | 1 2 3 4 5 6 | Groups: | php.doc |
| Request: | Send a blank email to phpdoc+get-969386888@lists.php.net to get a copy of this message | ||
On Sun, Feb 11, 2018 at 4:15 PM, Christoph M. Becker <cmbecker69@gmx.de> wrote:
> On 11.02.2018 at 23:56, Richard Quadling wrote:
>
>> We should be adding <void> if there is no return value. If a function can
>> return null, then that's a valid return type. […]
>
> Most functions return NULL, if you give them invalid parameter types,
> e.g. <https://3v4l.org/UIYGh>.
>
>> […] The issue here is that many
>> of the PHP functions return way too many types.
>
> ACK. However, changing that constitutes a BC break, and as such has to
> be thoroughly investigated (likely on a case by case basis), and most
> likely would require the RFC process
> (<https://wiki.php.net/rfc/howto>).
>
> --
> Christoph M. Becker
Hopefully we can fix this in PHP 8 by throwing TypeError, just as we
do with userland functions.