Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I'm confused about the rationale behind:

    |> fn($x) => array_column($x, 'tags')
Why is that inlined function necessary? Why not just

    |> array_column(..., 'tags')
?

I mean, I understand that it is because the way this operator was designed. But why?



> |> array_column(..., 'tags')

This syntax is invalid. But it will be possible next year with the proposed partial function application rfc

array_column(?, 'tags')

https://wiki.php.net/rfc/partial_function_application_v2




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: