Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:108466 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 3936 invoked from network); 11 Feb 2020 13:55:15 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 11 Feb 2020 13:55:15 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id A70841804F8 for ; Tue, 11 Feb 2020 04:09:09 -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-lj1-f178.google.com (mail-lj1-f178.google.com [209.85.208.178]) (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:09:09 -0800 (PST) Received: by mail-lj1-f178.google.com with SMTP id q8so11234973ljj.11 for ; Tue, 11 Feb 2020 04:09:08 -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; bh=67QSkiWodpMRA31I53ZbRwQDrn40PYHhdAWxdB4/VTs=; b=LsIW3oNXNYi8CZt4twfWZuIyeoANFHoLn1kaKb68hPlxnpEpUm+aASP64mUdIJuOQo Qjk20Bgb+lanoPqQg2UcsODEHD3fBgrf8rboqFuVuCDHgBFj0wHBJ5zAho052eL/aBCc NLb6/Gew9ByMS0DXu0u58PDsNwiZrf7hrIooV8PikNW074TAfWkG7NAYAqkbK9sCyg0x Ctnlweu/8dTObpupJ0rLdWK2zTEsDQJWZgPZileA+uUDIua939lNzENn0qzF33+zbyiC KQZgAyS/rLEdcI7YII0+7egQxq219ejU//Q6rPBOUAhOg3UqC6y465J8zWkfPyCFf8fV Iy7w== 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; bh=67QSkiWodpMRA31I53ZbRwQDrn40PYHhdAWxdB4/VTs=; b=VnY6jki3wdD9I+KSqdO/3rDSG/SAf//J1Mft+qzIeHwJT9QvmaGhCrISdbxzwH7PMS umAb8VTTVdzFgRNNr6WdJiFqkQSqhsFVQ2qbnyxcjI+bLPEsp2l25pUWM+1HGHO7B5px H0MYR1vTh60PNgqe4WLVCjx1gDrnIg7qqb268ZKpUv5575FeOiL0fFwlArS3K68CuAwQ dX71BOWt81wYL6GLpHXC8Qm+OaGQqZn/3aaM4TRSwTH3Dx/XCnQlaAxW3ujEVj/kaCNJ ZD6f5x8iPG73tAk5RbpUQt7L/3X6r3qJJHDJx9fdZ3KrW8Niktz3NzaY62wJEn194/Bk keYg== X-Gm-Message-State: APjAAAXmXIrbPWtdWzFsWaSqsTH0McsU+kH8lyBhEWrl2ePuREiFo9cm qwytolnnW+v0uVigqUgY8ytNJa2dnieXjq5Z5OP2+tQ2v6o= X-Google-Smtp-Source: APXvYqw/EQnWHWjgJ4Pc06X1yGivhyxNLGoAO7Hz8BMPquXlhIirbpEPbpCKqp99XFexL46OiRJ3vmZl52RjOz8tI7s= X-Received: by 2002:a05:651c:102c:: with SMTP id w12mr4069861ljm.53.1581422947607; Tue, 11 Feb 2020 04:09:07 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: Date: Tue, 11 Feb 2020 13:08:55 +0100 Message-ID: To: Diogo Galvao Cc: internals@lists.php.net Content-Type: text/plain; charset="UTF-8" Subject: Re: [PHP-DEV] [RFC] From: manuelcanga@gmail.com (Manuel Canga) Hi, Diogo That's right. I could be useful with classes as well. I was thinking about 'function' or 'func'. 'function' is more semantic, but 'func' is used with "short functions"( PHP 7.4 ) and these will be used for callbacks. Then I think 'func' will be more consistent. Thanks, Diogo, On Tue, 11 Feb 2020 at 12:51, Diogo Galvao wrote: > > On Tue, Feb 11, 2020 at 8:14 AM Manuel Canga 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