Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:108502 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 54744 invoked from network); 12 Feb 2020 05:42:35 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 12 Feb 2020 05:42:35 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 32E32180539 for ; Tue, 11 Feb 2020 19:56:36 -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=-1.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE, SUBJ_ALL_CAPS 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-yb1-f173.google.com (mail-yb1-f173.google.com [209.85.219.173]) (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 19:56:34 -0800 (PST) Received: by mail-yb1-f173.google.com with SMTP id z125so401706ybf.9 for ; Tue, 11 Feb 2020 19:56:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=newclarity-net.20150623.gappssmtp.com; s=20150623; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=xEj598GpYYFofrFIR3gs92QMaLRpRlBRbW2t54O6kJU=; b=aN/mo8GJT9E3huhU+7EnNHr97et5MDraAZKIt1L1ORU5QAMmKhx/Q4SF+m8aoRII6E L4aq9Hz7Ee66jBltXB6doTg8FF26ZuqoYHnmkYKOv82eMPpm07u7OTOG6NOuWGgVeEhE SpojIoJGAC3HgEedS3VSv4xYrgLPGn8Bsfem9bL5sKlP/1SrOdJGFMFALYqFC9IM8Ta7 QO1+kNny/j4WwiVRUBcPPrbISm2hR7l9JeTUauitLEegNOtZETHz+4saDdwRFy6yFYMG xyaQouGaom5Cg2TXIgi/r5ifVL3iOFA9fq0hPMXVmsh6lEruzryCiyIUK++ayjXUVhfu bBYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=xEj598GpYYFofrFIR3gs92QMaLRpRlBRbW2t54O6kJU=; b=NeMKPtY7wC5nZAdJKDi2JcibdiZFgnzR/JDM1YRwQoFvyK5bGNeDSnyrSx9AOAVdLM cxTnp+G5lnJf+fEaEt7MeaMQLEL3XjBwg9+v6PoZ6RF/lNdnahgEm7VxhdrruVUI9rGf dMGYx2TkpMhqAaSgEHpJu65gkQCkArPJ82IVECiO5ek0BsYxmLTLYziNNW3hz4m+vTXU ipoBBtCtrNNtXxVslRqj4RhdOoxiKy31AN1TESBcxMdEfemjPhCf3Z5m1Vg9/FtyXraF iTNrsi4I/d2FpSiCiQyVim/+tdhygQ0BbhIKADwFB42FGWjtDEc4XMfdItTMarp0psTo lO2w== X-Gm-Message-State: APjAAAUcsldmHMDaSU0yknukEyLiLNkXiHuhaFXrTWEIx97rYOGdU3r1 EnhiJDaQknmVYAKOXP/G4Cz1dQ== X-Google-Smtp-Source: APXvYqwKFNZwIFclYS2nDlXoPUjCVL+dZVmQJvLZknLgLGBf5VQ/0kNR2NknQYRrcRoK6lMQuzBTKw== X-Received: by 2002:a81:17cd:: with SMTP id 196mr2476202ywx.153.1581479793051; Tue, 11 Feb 2020 19:56:33 -0800 (PST) Received: from ?IPv6:2601:c0:c680:5cc0:6580:673d:95e8:48ed? ([2601:c0:c680:5cc0:6580:673d:95e8:48ed]) by smtp.gmail.com with ESMTPSA id q185sm2907408ywh.61.2020.02.11.19.56.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 11 Feb 2020 19:56:32 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) In-Reply-To: Date: Tue, 11 Feb 2020 22:56:30 -0500 Cc: internals@lists.php.net Content-Transfer-Encoding: 7bit Message-ID: <61C2F6E3-BD48-4307-A70E-692364AB6FA3@newclarity.net> References: To: Manuel Canga X-Mailer: Apple Mail (2.3445.104.11) Subject: Re: [PHP-DEV] [RFC] From: mike@newclarity.net (Mike Schinkel) > On Feb 11, 2020, at 6:13 AM, 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 "" I proposed ::function on the list a month ago: - https://externals.io/message/108045#108084 I had started by suggesting ::interface and ::trait: - https://externals.io/message/108045#108069 Marcio Almada suggested that we should use a general ::nameof instead: - https://externals.io/message/108045#108085 -Mike