Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:76328 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 6458 invoked from network); 4 Aug 2014 01:00:51 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Aug 2014 01:00:51 -0000 Authentication-Results: pb1.pair.com header.from=ajf@ajf.me; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=ajf@ajf.me; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain ajf.me designates 192.64.116.199 as permitted sender) X-PHP-List-Original-Sender: ajf@ajf.me X-Host-Fingerprint: 192.64.116.199 imap11-2.ox.privateemail.com Received: from [192.64.116.199] ([192.64.116.199:52132] helo=imap11-2.ox.privateemail.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 14/99-25844-24BDED35 for ; Sun, 03 Aug 2014 21:00:51 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.privateemail.com (Postfix) with ESMTP id DBD408800E4; Sun, 3 Aug 2014 21:01:12 -0400 (EDT) X-Virus-Scanned: Debian amavisd-new at imap11.ox.privateemail.com Received: from mail.privateemail.com ([127.0.0.1]) by localhost (imap11.ox.privateemail.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id nSQdw1v_XRun; Sun, 3 Aug 2014 21:01:12 -0400 (EDT) Received: from [192.168.0.15] (unknown [90.210.122.167]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.privateemail.com (Postfix) with ESMTPSA id 9982D8800DB; Sun, 3 Aug 2014 21:01:11 -0400 (EDT) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) In-Reply-To: <20140804005307.0B5CC261BFB@dd15934.kasserver.com> Date: Mon, 4 Aug 2014 02:01:08 +0100 Cc: internals@lists.php.net Content-Transfer-Encoding: quoted-printable Message-ID: <8FA1FD0A-8FD2-47EF-A8AB-9BEF06AEF919@ajf.me> References: <20140804005307.0B5CC261BFB@dd15934.kasserver.com> To: Thomas Bley 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 4 Aug 2014, at 01:53, Thomas Bley wrote: > from userland perspective, I would prefer to open the Closure = constructor instead of adding new syntax: >=20 > $qux =3D new FooBar(3); > // $func =3D &FooBar::getStatic; > $func =3D new Closure(array('FooBar', 'getStatic')); > $func($qux); // 3 You can actually do that already in a convoluted way: $func =3D (new ReflectionMethod(=93FooBar::getStatic=94)->getClosure()= ); Though it must be explicitly bound in the case of a non-static method. -- Andrea Faulds http://ajf.me/