Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:76397 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 83670 invoked from network); 6 Aug 2014 15:07:43 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 6 Aug 2014 15:07:43 -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:34625] helo=imap11-3.ox.privateemail.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 08/92-02707-DB442E35 for ; Wed, 06 Aug 2014 11:07:42 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.privateemail.com (Postfix) with ESMTP id 406AA8800DB; Wed, 6 Aug 2014 11:08:08 -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 H9tBcDWk2dsp; Wed, 6 Aug 2014 11:08:08 -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 7303E8800D2; Wed, 6 Aug 2014 11:08:05 -0400 (EDT) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) In-Reply-To: <53E24345.6070309@ralphschindler.com> Date: Wed, 6 Aug 2014 16:08:02 +0100 Cc: Marco Pivetta , PHP Internals List Content-Transfer-Encoding: quoted-printable Message-ID: References: <53E0F651.1020101@ralphschindler.com> <53E0FFF2.3050803@ralphschindler.com> <53E24345.6070309@ralphschindler.com> To: Ralph Schindler 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 6 Aug 2014, at 16:01, Ralph Schindler = wrote: > When you put it like this, that further enhances my argument for = adding > a call() and/or a bindCall(). Having to rely on __invoke() means > you're coding around and relying on an implementation detail, as = opposed > to the class's published API. __invoke *is* in the published API, it=92s just not seen properly by = Reflection or the docs. Yes, internally it=92s implemented weirdly, but = it is part of the API proper. > It would be nice to be able to call closure in an object oriented way, > in addition to the language-level call $func() and the > functional/procedural way to call it call_user_func($func), after all, = at current it seems OO-isms are more rampant in PHP than other = programming paradigms. Use () or __invoke(). Unfortunately you can=92t do ->foo()() just now, = sure, but I believe Nikita=92s Uniform Variable Syntax fixes that, so = it=92s not a problem. ->call doesn=92t cater to this use case. -- Andrea Faulds http://ajf.me/