Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:108550 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 90960 invoked from network); 13 Feb 2020 21:58:24 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 13 Feb 2020 21:58:24 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id B79A9180531 for ; Thu, 13 Feb 2020 12:12:50 -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.2 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, 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-yw1-f43.google.com (mail-yw1-f43.google.com [209.85.161.43]) (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 ; Thu, 13 Feb 2020 12:12:50 -0800 (PST) Received: by mail-yw1-f43.google.com with SMTP id a125so3187767ywe.12 for ; Thu, 13 Feb 2020 12:12:50 -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=0AQEJQcdlrA/bZuRTS8QIgFQtCRct3NHEpcnunTUjK0=; b=oVCcZGKg826lPcMt1s2ta8Cv350MMmRgwyARRxQFD4Vmfx3FKvQ1XFASDd2ybRCeA1 8hLyxrNHal3atyo0x738T7a2o9w6x3Znf1mFE1H+aCpwjnjeX88XU/gIupH8XjQscX5+ Lzo97Ewo/NdpDLLwnv3CxyjXKjkHHjpAfol0E3tZuQ5TbdXjCz+CP+h107qLxbVRdx2k /bL9kRlQ72IdPC7XUoYXd3Zj8lvyPmIYF+wUKIoHVvF8YrM2+Z2HZSlrSfNXaGK6/s2i 3U12weBiXxx0zmNcXX8ZxLbN4nPTkAEfHsS6sxGuna+Q3wfMNDnBkoWFTR81oCKBJyLH KpBA== 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=0AQEJQcdlrA/bZuRTS8QIgFQtCRct3NHEpcnunTUjK0=; b=HLK52IFuqxIvf0SSkEDKMhqPmcxh5rTw7KH6RTvizRY/MUmCj0W0NmYD+dkxNLb5SG tX40EYnwSgJMBH5HUnsHbnDLmBq6R89uls+2/kyfIxLfqlwBmMsTYvFj/WVPWLRoJrL2 sMGzEOLGj12uATjcauhDC85ifoTYbnk+Sc7Cyu5jn8L6gReBRd2xSmhUhFax2QcoMIp0 XZrdutdmhLtNkv+aexniNBhxflpwgBpMU0WeFOdDvcNyiNWB6XWUQbN0/hus4Iu5C668 xSyI/R5jE0+e6GQrQRNSGGZ4dBAx+TuVYEMxkrLskgpx2T7u7VbsOmscuecGLXt5Bd7J q9SQ== X-Gm-Message-State: APjAAAUG0izc9xdn+1NASKHDsNaIDOO5QL4ZM4X51XU/zVvIy8eSarKG 1YNxdc1Npx2cEj4VsxTk6Zb7wToACX/2Dg== X-Google-Smtp-Source: APXvYqzHJCwDqIq3nb97myTDT6eZoj2pSg4XwWKj+CaasGnBxcAvsExBRrjY7Td0nCBwqWHVkxn3hA== X-Received: by 2002:a81:380b:: with SMTP id f11mr16289190ywa.145.1581624768716; Thu, 13 Feb 2020 12:12:48 -0800 (PST) Received: from ?IPv6:2601:c0:c680:5cc0:c40d:6267:8a93:b5b9? ([2601:c0:c680:5cc0:c40d:6267:8a93:b5b9]) by smtp.gmail.com with ESMTPSA id i72sm1514890ywg.49.2020.02.13.12.12.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 13 Feb 2020 12:12:47 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) In-Reply-To: Date: Thu, 13 Feb 2020 15:12:47 -0500 Cc: php internals Content-Transfer-Encoding: quoted-printable Message-ID: <8D1FD9A3-C0F0-4B70-8D6C-F85275E4D367@newclarity.net> References: <10FCCCED-B8AE-4394-91B3-0FEB448E2398@gmail.com> <2C404984-AD76-4CDF-8E1A-04DF8EF024DD@newclarity.net> To: Larry Garfield X-Mailer: Apple Mail (2.3445.104.11) Subject: Re: [PHP-DEV] [RFC] From: mike@newclarity.net (Mike Schinkel) > On Feb 13, 2020, at 1:48 PM, Larry Garfield = wrote: >> But since I seem to be in the minority of caring about the name, let = me=20 >> propose the following which was influenced by Larry Garfield's most=20= >> recent post. Since it seems that people want the convenience of a=20 >> short notation to get a closure, how about this: >>=20 >> function foo{} >>=20 >> foo::function =E2=80=94 Returns name of function >> foo::fn =E2=80=94 Returns closure for function=20 >>=20 >> Since using `fn` creates anonymous function closures it kinda makes=20= >> sense that `::fn` would return a closure. >>=20 >> -Mike >=20 > thinking-face-emoji.gif. I could be convinced of that. It seems like = "both" is a possible solution, but my concern would be someone using one = of them in a case where either works, inadvertently, when the callee is = expecting just one. Eg, getting into the habit of using foo::fn, and = then using it on a builder routine that chokes "later" when it tries to = serialize something. True.=20 But it would be a really high bar to say we can only add new features if = we can completely protect the developer from themselves. At some point = we have to assume programmers are adults, or at least can take = responsibility for learning how the language works.=20 -Mike P.S. OTOH, if the routine that requires ::function and not ::fn were to = type hint the parameter, it would choke with an applicable error = message.=