I wonder why this is not valid:
Class Foobar
{
private function foo(): void {
return;
}
public function bar(): void {
return $this->foo(); // Compile Error: A void function must not return a value
}
}
I know the RFC says this:
A function with a void return type, or void function, may either return implicitly, or have a return statement without a value
But IMHO foo
is void, thus it should be allowed...