Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:76418 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 60698 invoked from network); 10 Aug 2014 21:06:08 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 10 Aug 2014 21:06:08 -0000 Authentication-Results: pb1.pair.com smtp.mail=ajf@ajf.me; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=ajf@ajf.me; sender-id=pass Received-SPF: pass (pb1.pair.com: domain ajf.me designates 192.64.116.216 as permitted sender) X-PHP-List-Original-Sender: ajf@ajf.me X-Host-Fingerprint: 192.64.116.216 imap10-3.ox.privateemail.com Received: from [192.64.116.216] ([192.64.116.216:41839] helo=imap10-3.ox.privateemail.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B2/60-56799-EBED7E35 for ; Sun, 10 Aug 2014 17:06:07 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.privateemail.com (Postfix) with ESMTP id DA51B2400DE; Sun, 10 Aug 2014 17:06:42 -0400 (EDT) X-Virus-Scanned: Debian amavisd-new at imap10.ox.privateemail.com Received: from mail.privateemail.com ([127.0.0.1]) by localhost (imap10.ox.privateemail.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 69HrgOpgMoF4; Sun, 10 Aug 2014 17:06:42 -0400 (EDT) Received: from [192.168.0.2] (05439dda.skybroadband.com [5.67.157.218]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.privateemail.com (Postfix) with ESMTPSA id 6F1F02400DA; Sun, 10 Aug 2014 17:06:41 -0400 (EDT) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) In-Reply-To: <4c89fa2a-a4da-46a9-9872-6d2e5346fed1@email.android.com> Date: Sun, 10 Aug 2014 22:06:38 +0100 Cc: "internals@lists.php.net" Content-Transfer-Encoding: quoted-printable Message-ID: <7AC9A96B-9B45-45B2-BBD1-1E61CC6075E8@ajf.me> References: <53DF2BED.10103@sugarcrm.com> <06F3EF08-21B1-49AD-9D9D-5043C69AC1D8@ajf.me> <53DFE1FC.5040206@gmail.com> <4c89fa2a-a4da-46a9-9872-6d2e5346fed1@email.android.com> To: Rowan Collins X-Mailer: Apple Mail (2.1878.6) Subject: Re: [PHP-DEV] [RFC] Closure::call and Function Referencing as Closures From: ajf@ajf.me (Andrea Faulds) On 10 Aug 2014, at 22:00, Rowan Collins wrote: > You're rather pre-supposing the proposed syntax there, and letting it = lead the semantics rather than vice versa. The point is it would be = useful to allow creation of a pre-bound closure based on an existing = method, so it would be good if the syntax allowed that possibility. Huh? I=92m saying it should do the same thing calls do for the sake of = consistency. It=92d be nice if (&$foo->method) could work, but sadly it = doesn=92t. > Getting a static reference to a non-static method and then binding it = feels a bit like JS, which has a completely different notion of what a = method is. JavaScript=92s methods are bound based on what object they=92re used on. = PHP=92s methods are statically bound. That=92s not quite the same thing = at all. >> Using the =91Closure=92 class is unfortunate, but I don=92t really = want to >> make unnecessary new Function/Method/etc. classes given they=92d all >> share the same implementation anyway. >=20 > I'm not so sure they'd be identical - a static method or plain = function would presumably error if you tried to bind it, for instance. So do static closures, as I=92ve already mentioned. I don=92t really see what=92s wrong with using our existing class for = functions. -- Andrea Faulds http://ajf.me/