Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:76437 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 53580 invoked from network); 11 Aug 2014 19:33:25 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Aug 2014 19:33:25 -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 198.187.29.245 as permitted sender) X-PHP-List-Original-Sender: ajf@ajf.me X-Host-Fingerprint: 198.187.29.245 imap11-3.ox.privateemail.com Received: from [198.187.29.245] ([198.187.29.245:57856] helo=imap11-3.ox.privateemail.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 69/00-53075-28A19E35 for ; Mon, 11 Aug 2014 15:33:24 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.privateemail.com (Postfix) with ESMTP id DAF788800E2; Mon, 11 Aug 2014 15:34:00 -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 riLgKoshkWjT; Mon, 11 Aug 2014 15:34:00 -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 29BE88800D5; Mon, 11 Aug 2014 15:33:58 -0400 (EDT) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) In-Reply-To: Date: Mon, 11 Aug 2014 20:33:55 +0100 Cc: PHP internals Content-Transfer-Encoding: quoted-printable Message-ID: <35D0408F-BCE1-436C-AFB3-71EDC2A35E1F@ajf.me> References: To: Dmitry Stogov 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 11 Aug 2014, at 20:07, Dmitry Stogov wrote: >=20 > may be: >=20 > $a =3D function strlen; >=20 > or >=20 > $a =3D function(stren); >=20 > but these are not excellent as well :( I wanted to do the first, but it caused a shift/reduce conflict in the = parser due to ambiguity with function () {}. The latter has been = suggested also. Both might be possible with an AST, but I=92m not really = keen on either, they=92re quite verbose. > I may implement this part if the RFC will be accepted. > Actually, most of the code may be just copy-pasted from > ZEND_INIT_STATIC_METHOD_CALL. Interesting, I=92d certainly appreciate it. :) One thing to note is that = the patch is currently implemented in the simplest way possible, wherein = it just stores constant strings in the opcode. You could optimise it by = binding ahead-of-time and passing the zend_function pointer itself, but = I didn=92t want to do that as it complicated things. -- Andrea Faulds http://ajf.me/