Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:88664 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 75108 invoked from network); 4 Oct 2015 11:31:30 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Oct 2015 11:31:30 -0000 Authentication-Results: pb1.pair.com header.from=pajousek@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=pajousek@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.223.175 as permitted sender) X-PHP-List-Original-Sender: pajousek@gmail.com X-Host-Fingerprint: 209.85.223.175 mail-io0-f175.google.com Received: from [209.85.223.175] ([209.85.223.175:32948] helo=mail-io0-f175.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 12/57-31315-01E01165 for ; Sun, 04 Oct 2015 07:31:29 -0400 Received: by iofh134 with SMTP id h134so160589914iof.0 for ; Sun, 04 Oct 2015 04:31:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=t7k3NTVWOdfDOFHRiYfd/0dG9RLTw6wyXRKLZOiGjpY=; b=qJ3Jsosg+ol/A/q4ZitCspYOV2hAMtd+lh2KP7M6MZFdGwgP84gBK4Qpg8gz5aEJ5p 44vJn7gv74aF/Em52+GOY8xY9e2ykIzR1WrpGnUkwzq9JK0jbiOCE6yhA3PfKKR1APyA 6YLXjmyv12Go1W0DR9c29V1LcKrSLInD8fohuVVWX215rqPAb9B/JtOtONkJ/V+8pSvl NMjbE8zn4Tf0atDRZ4Zx2S1LHiFF3ewq3nM65ATBFsmVlk4riM1CnQGnftrGwUXPgFk/ on4PjQBmAXRRz/YdI1eDS8Qk29a+sOP+6m4Chgkm4MjzqJXfcvbeez9k3dnHTtfN2oCV /cNA== MIME-Version: 1.0 X-Received: by 10.107.160.143 with SMTP id j137mr24757539ioe.13.1443958286313; Sun, 04 Oct 2015 04:31:26 -0700 (PDT) Received: by 10.107.189.132 with HTTP; Sun, 4 Oct 2015 04:31:26 -0700 (PDT) In-Reply-To: References: Date: Sun, 4 Oct 2015 13:31:26 +0200 Message-ID: To: Marco Pivetta Cc: Dan Ackroyd , PHP Internals List Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] [RFC] [DISCUSSION]: Closure from callable From: pajousek@gmail.com (=?UTF-8?Q?Pavel_Kou=C5=99il?=) On Sun, Oct 4, 2015 at 12:41 PM, Marco Pivetta wrote: > As mentioned already by Andrea: why not just a named constructor on the > closure class, like `Closure::fromCallable(callable $callable)`? > Much simpler, easier to find, etc etc... > On Sep 29, 2015 11:23, "Dan Ackroyd" wrote: > >> Hello internals, >> >> I'd like to start a discussion of a proposal to allow closures to be >> created in user-land without having to use a whole lot of reflection >> code. >> >> https://wiki.php.net/rfc/closurefromcallable >> >> Thanks to Joe and Bob for the assistance in the patch. >> >> cheers >> Dan >> Ack >> >> -- >> PHP Internals - PHP Runtime Development Mailing List >> To unsubscribe, visit: http://www.php.net/unsub.php >> >> Hello, and what about changing the empty ctor of Closure to __construct(callable $callable)? And the usage would be new Closure([$this, 'abc']);? Regards Pavel Kou=C5=99il