On Tue, Feb 11, 2020 at 8:14 AM Manuel Canga <manuelca...@gmail.com> wrote:
>
> Hi internals,
> I Would like to present a possible new "::func resolution" for your
> consideration.
...
> use function \My\I18N\i18n_translate;
>
> $mapped_array = array_map(i18n_translate::func, $array);
...
> What is your opinion ? Do you see it useful ?

I've wished for this on many occasions and think it'd be really useful, as long
as it could work with methods as well:

$mapped_array = array_map(I18N::translate::function, $array);

For what it's worth I guess it could just return [I18N::class, 'translate'].

Also for keeping consistency and avoiding new keywords wouldn't it fit better as
::function instead of ::func?


Best regards.
Diogo

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to