Jordi Kroon:
function giveMeFourtyTwo() {
return 42
|> return;
}
...
fn () => 'hello world'
|> strlen(...)
|> return;
Thanks for examples. I've already had a test for first case
(https://github.com/vadimonus/php-src/blob/pipe-to-return/Zend/tests/pipe_operator/pipe_to_return/two_returns.phpt)
Now i have added test for second case
(https://github.com/vadimonus/php-src/blob/pipe-to-return/Zend/tests/pipe_operator/pipe_to_return/008.phpt)
to be sure it's not valid and cannot be accidently treated as returning
of (fn () => 'hello world' |> strlen(...)) from function as callable
--
Vadim Dvorovenko