Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:108461 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 91309 invoked from network); 11 Feb 2020 13:13:07 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 11 Feb 2020 13:13:07 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 9215B180210 for ; Tue, 11 Feb 2020 03:26:59 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-lf1-f45.google.com (mail-lf1-f45.google.com [209.85.167.45]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Tue, 11 Feb 2020 03:26:59 -0800 (PST) Received: by mail-lf1-f45.google.com with SMTP id y19so6725035lfl.9 for ; Tue, 11 Feb 2020 03:26:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=IvTWsojit7MPrlgAV8c8z1n4BwQLszDXZgP1fTgQ4Vw=; b=iwW0+9ZRXi+g0jM2SNw+mjjWGbyYiYaKbycDDw15Gpvl7AqbKzeCrR8Huyn4/osidP 0SHStUZB+F3PKizsLtmiJ+AL6aAAPH5jZ4n095w9PXYpJO+jI0yHqapLwU0eprKOqC9D 4UoUztdCl0k77fm/sdsrNSk80YuIaGL0q1Tfr8hT4LBOwdduhPdXHaM9LJUMxXZpGHF1 ia5OrDXG4rlDoUIXcrgjbHpUfIGovnjFLslQzN97KBhnKWcXlLjds7EAjqXAETCk2gSe WAyrsRYTWmEGWq4vd+CpoGxhQAwC/sNtHkobDmOnsAIFIpDZpP+uYA7/myztGKScfDKs o1SA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=IvTWsojit7MPrlgAV8c8z1n4BwQLszDXZgP1fTgQ4Vw=; b=UiJq+MfjpF3c/5vzva5xiF5RV0IRhbEiAlU76+pZz7bPgwjTUJ1Nzx3kFRvSB6B1Qk hbcx8CNA+F0Mq/RDjNk5V8BncsssFLsHsuNFREM1pzcpT7p79hS5Odr2+hldYTHD+Urr V5ULH3ZUP1HKLATwSWPzsGxqlgARqAIF79k2XSO/pOnt0jl+fPG4+y45VrRIbEvHTT9O JgB6yN6JNpT+D7Q4pf5+jJE6G7RhAWFXWvMkoWgLK8v65YChTESYcHeZ33NBl7RXJGbw cN4fS3ZlKciphiZM+j85SBzH3bKdnOObeOl2DSIA4vRpLIqX+svqvEgYnG+6vg9F0/Su 8H7Q== X-Gm-Message-State: APjAAAX4rO1yuVMcEXxprtWyOIkzoXjahS10Ah3F5SCDNdxO8I6hANxA LmUWLHHuEkPILoDIj9Uo5FnN9MJ+83TetnBDppAx52ZC X-Google-Smtp-Source: APXvYqwmrUKNWJMW1q5fvqMCkST6t2LkXYCjS3rysET9Bb/3HDq2h3LvD/AQ+pQ0ROMOMGtUe1sGDPasV7Aq0HxXLxg= X-Received: by 2002:a19:8c4d:: with SMTP id i13mr3418873lfj.42.1581420417011; Tue, 11 Feb 2020 03:26:57 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: Date: Tue, 11 Feb 2020 12:26:45 +0100 Message-ID: To: internals@lists.php.net Content-Type: text/plain; charset="UTF-8" Subject: Re: [RFC] ::func resolution for functions From: manuelcanga@gmail.com (Manuel Canga) I'm sorry. I forgot subject due to nerves. I add it. On Tue, 11 Feb 2020 at 12:13, Manuel Canga wrote: > > Hi internals, > I Would like to present a possible new "::func resolution" for your consideration. > > In first place, PHP now support "::class" in this way: > > use My\I18N; > > $mapped_array = array_map([I18N::class, 'translate'], $array); > It avoid add Full I18N namespace in callback. > > However with functions is different: > > use function \My\I18N\i18n_translate; > > $mapped_array = array_map('\My\I18N\i18n_translate', $array); > > What is the useful here of importing the function?. > My proposal is ":func" in order to avoid full namespace in callback of functions. E.g: > > use function \My\I18N\i18n_translate; > > $mapped_array = array_map(i18n_translate::func, $array); > > "::func" should validate if a function with `` is imported. In this case, "::func" is replaced with FQN of this function, otherwise with only "" > > What is your opinion ? Do you see it useful ? > > Thanks and I'm sorry for my English( I'm a Spanish ). > > Regards > >