On 20 January 2017 00:59:59 GMT+00:00, Levi Morrison <le...@php.net> wrote: > >I empathize that you don't like string-name callables (I really don't >like them either) but this RFC helps avoid the string if you want to. >Consider > > // without my proposal: > array_map('trim', $input) > > // with it: > array_map(trim($$), $input)
Sure, like I said in my previous message, ($$) acts as a shorthand for Closure::fromCallable on any callable that takes one argument. But syntax for getting a reference to a function has been discussed before, and it would be a shame to be able to do it for this special case but not others. Straw manning, if name::fn got a reference to a function from its name, you could do: $foo |> trim::fn Which makes more sense than using a partial application operator without applying anything. Regards, -- Rowan Collins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php