Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:76777 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 15579 invoked from network); 21 Aug 2014 19:22:08 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 21 Aug 2014 19:22:08 -0000 Authentication-Results: pb1.pair.com header.from=thegreatall@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=thegreatall@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.218.48 as permitted sender) X-PHP-List-Original-Sender: thegreatall@gmail.com X-Host-Fingerprint: 209.85.218.48 mail-oi0-f48.google.com Received: from [209.85.218.48] ([209.85.218.48:62203] helo=mail-oi0-f48.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id BE/C6-18459-FD646F35 for ; Thu, 21 Aug 2014 15:22:07 -0400 Received: by mail-oi0-f48.google.com with SMTP id h136so7027578oig.35 for ; Thu, 21 Aug 2014 12:22:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=w87SNbV8VkJePCf5sP8zPhv3Ee5ybBYhigz6APnEuBI=; b=eGIOjSJNd94J6dHSLV1SYWsYh+4JxXjM+wJ7oQWd32xEe6el3+rLuPsO4ILqWo/78V uOpDKIZoen3AoRcME/5gnLYqfrETbbWxXYmKVylmU2ZMr4wMLx8TNKw9KPZrxw4/or+7 BKhmxVPqqe0TyhpJSJEXY+i8wpAdEvIFWHOuTuXQlBUh3roJ2iyusHLUfpFTl8E8KQUS pHW41A/YXAx0sDLC3ZymCMect+X+D6yZzsM7eHAJ/SRZ50EaO0igNIEhw44ksYfuiVQb mEkGMx1RI/qd0z6GNVQje2kFBx9g1Vcjn0D+XAGIkqbGKTiMg4vlEDuKIWcZlezU6Cha Zg6w== MIME-Version: 1.0 X-Received: by 10.60.42.226 with SMTP id r2mr411771oel.69.1408648924902; Thu, 21 Aug 2014 12:22:04 -0700 (PDT) Sender: thegreatall@gmail.com Received: by 10.76.109.170 with HTTP; Thu, 21 Aug 2014 12:22:04 -0700 (PDT) In-Reply-To: References: Date: Thu, 21 Aug 2014 14:22:04 -0500 X-Google-Sender-Auth: SZwc-TVUQ2foWmSY3NaOFXb1Nnc Message-ID: To: Levi Morrison Cc: Andrea Faulds , PHP Internals Content-Type: multipart/alternative; boundary=001a11c20c4cc83c70050128a289 Subject: Re: [PHP-DEV] [VOTE][RFC] Closure::apply() (re-opening) From: nathanbruer@gmail.com (Nathan Bruer) --001a11c20c4cc83c70050128a289 Content-Type: text/plain; charset=UTF-8 I suppose calling it statically a user would probably want to recycle the same function/closure, so binding/calling it real time would have little impact if done properly. On Wed, Aug 20, 2014 at 2:30 PM, Levi Morrison wrote: > On Wed, Aug 20, 2014 at 11:51 AM, Nathan wrote: > > The only thing I'd suggest is like I said in the last email is to make > the > > syntax more like Closure::bind(Closure $closure, object $newThis, [mixed > > $newScope = 'static']) and make it Closure::apply(mixed $newObjectOrScope > > [, mixed ... $parameters]) $newObjectOrScope would then allow a user to > > supply a class name or an object. If class name is passed you have access > > to "static::", "self::", and "parent::" inside the function everything > else > > works as described in the RFC. > > > > Give the ability to call a closure as a static method of a class or a > > normal method of an object. Right now the only way to do it is doing > > binding and creating new closures and calling those closures then > > destroying them. > > I think you are confused. This proposal basically binds the closure to > the new object and invokes it immediately. I genuinely don't see how > it being statically bound to the object will make a difference. Please > elaborate. > --001a11c20c4cc83c70050128a289--