Re: [RFC] Transform void into an alias for null
| From: | Kamil Tekiela | Date: | Mon, 02 Jun 2025 17:05:54 +0000 |
| Subject: | Re: [RFC] Transform void into an alias for null | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-127538@lists.php.net to get a copy of this message | ||
The RFC mentions that this will now become valid:
function foo(): void {
return null;
}
But what about the opposite:
function foo(): null {
return;
}
or what Larry was trying to suggest:
function foo(): null {
print 'test';
}
$val = foo();