Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:108472 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 15293 invoked from network); 11 Feb 2020 14:29:11 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 11 Feb 2020 14:29:11 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id D02551804AB for ; Tue, 11 Feb 2020 04:43:06 -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.6 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, 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-lf1-f44.google.com (mail-lf1-f44.google.com [209.85.167.44]) (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 04:43:06 -0800 (PST) Received: by mail-lf1-f44.google.com with SMTP id t23so6889358lfk.6 for ; Tue, 11 Feb 2020 04:43:06 -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 :cc:content-transfer-encoding; bh=vDNhJ+kK1TFfZ8uz49qMe01eztUEf5W8Bvh8Qoxshzo=; b=FKFh8JXNhOvVB+9sHxNRHQpttpRcxBl8ckNd1uzoZLFYvtZJQQVxtXAsArHS1JYdBs X7q1CUY7MwwvzSJ3mPvHKXDot38DBXiKasi29DSuq5ax9rkPUIh1r15WN0SMMFioya+P VrL1EBuG3uOERaiyb2KmNwxchiMP+n6jq0eZdtVrK/XH9UJQjNMDSX4MC2w7LwtQ0Olc 93oFdudceLwejjqbJ5B4xm9YCFb38x0X6WUiPJ7v48EQJlFRJBQV9+MbFpvlUT0Q4v+e K2z/0kVuEHPca5NdvDCLEtjttT6MLIZiTWguPtVJNYvroDeMm3KvXoH7rWm/GYBQMpY7 Thew== 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:cc:content-transfer-encoding; bh=vDNhJ+kK1TFfZ8uz49qMe01eztUEf5W8Bvh8Qoxshzo=; b=d1wAWaw735WjjGwoGm5qzZytJgTKqGEYWys7vBBGhPO3U67d45ObyNSxXjbDTugktU 2mp/7cOKwDAYwpKDhQHMK8qXsgLo4v/TF01MMQ47NuqSndTibs+P1yZoFL5foUBOAjPT Wki6P+R0abNK0+mm0BCuUOIz28+L044yGS0CsePZhouFghDA7Z3g8W5CyARCnONoKU0I fTrSb6B7Jt5ytcJN5DA0K1El3nO9aOWZi0pjjPqf+Z02BQ6uN01jWWNfzJsTN/AzKtZ2 CSzmFvwRLsPdo/mfaJiH7WkHMhdeyfy1OUR9WocR0kwLof8o6d6/APqHcB6sB4dTT7jV RXow== X-Gm-Message-State: APjAAAUXlpAR0EzRGuGqVzj1/AqKlvMoaTQafTeMXa5SyXV0FEPO66iq 8XxLxWof+uxQGS5Yh1g9p/3AG8SjBle1IopPxkQ= X-Google-Smtp-Source: APXvYqx1/T5DYBm182K53Iu6ImXku/CXxfaKi3rK39+I/EhPH3ElF2lqsFgfPbX44aYBbQfz1d933wnbUdqUxvksLWM= X-Received: by 2002:a19:5013:: with SMTP id e19mr3522593lfb.8.1581424984004; Tue, 11 Feb 2020 04:43:04 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: Date: Tue, 11 Feb 2020 13:42:52 +0100 Message-ID: To: Nicolas Grekas Cc: Diogo Galvao , PHP Internals List Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] [RFC] From: manuelcanga@gmail.com (Manuel Canga) On Tue, 11 Feb 2020 at 13:16, Nicolas Grekas wrote: > > > > Le mar. 11 f=C3=A9vr. 2020 =C3=A0 12:52, Diogo Galvao = a =C3=A9crit : >> >> On Tue, Feb 11, 2020 at 8:14 AM Manuel Canga wro= te: >> > >> > Hi internals, >> > I Would like to present a possible new "::func resolution" for your >> > consideration. >> ... >> > use function \My\I18N\i18n_translate; >> > >> > $mapped_array =3D 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 =3D array_map(I18N::translate::function, $array); >> >> For what it's worth I guess it could just return [I18N::class, 'translat= e']. > > > I wish this would return a Closure instead, making $foo::function the equ= ivalent of Closure::fromCallable($foo). Hi, Nicolas, Currently, when ::class is used, class with can or cannot exists in that moment. Using ::func( or ::function ), I think should keep the same behavior. Using ::func as alias of "Closure::fromCallable" check if function exists in that moment. It is certainly useful, but, I think it's more important be consistent Thanks, Nicolas,