[PR][php-src][#1080][master] - Correct and test none/null return types distinction
| From: | noreply@php.net | Date: | Sun, 15 Feb 2015 21:24:27 +0000 |
| Subject: | [PR][php-src][#1080][master] - Correct and test none/null return types distinction | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-2336@lists.php.net to get a copy of this message | ||
You can view the Pull Request on github:
https://github.com/php/php-src/pull/1080
Pull Request Description:
Currently:
1.
function foo(): array {} produces the "must be an instance of int, **none**
returned" error
2. function foo(): array { return; } produces the "must be an instance of int,
**null** returned" error
3. function foo(): array { return null; } produces the "must be an instance of
int, **null** returned" error
I think the 2nd case is wrong. return; doesn't return an explicit value, neither
does omitting a return statement altogether, so it should say "none" and not
"null" for that case.
This patch fixes the 2nd case to produce "none", and adds tests.