Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:93350 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 92249 invoked from network); 16 May 2016 08:35:23 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 May 2016 08:35:23 -0000 Authentication-Results: pb1.pair.com smtp.mail=ocramius@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=ocramius@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.43 as permitted sender) X-PHP-List-Original-Sender: ocramius@gmail.com X-Host-Fingerprint: 74.125.82.43 mail-wm0-f43.google.com Received: from [74.125.82.43] ([74.125.82.43:36855] helo=mail-wm0-f43.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 6F/B2-65275-94689375 for ; Mon, 16 May 2016 04:35:22 -0400 Received: by mail-wm0-f43.google.com with SMTP id n129so91861552wmn.1 for ; Mon, 16 May 2016 01:35:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=H6Cd8Gfqt7C2obrV83hyiKnTPLS9QjIkghreUZt4tNs=; b=Bw2qwUN4MKrauXOrF0xgM+DoVuKGqOpux3IkNcC4kd/rC1ncG+9sitoUUt8DWqKmt/ 7J7agMd2k2v3pM+/KD4XN7ARQkeATovyQABlCPSpTtZiP8vEjg+Wdbk179vEfwVvNM/b hGbV5Q76ryAshzuL/1rhKiTQQ6KR3vYFowLaecGJui1EhenCeKiypFLPKXfa2Lv5hkmm e9E2OpguTv6ry4W3ZHKBu33ZnOKP2K2+D2cr/YPKB1Y6z0+AnVWU5Q/1ZfrKii7V4Mev ZaF911oUEWZ3MKqgDTOUhliRVnx/8PvyfRjcSstyk7TIlpyNt2tpAvOlxk0HjLlhgBoR avyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=H6Cd8Gfqt7C2obrV83hyiKnTPLS9QjIkghreUZt4tNs=; b=KasKYCyfGtIy9f6/MnAOoR2+G0EK0d871VBmNQUEkCV1JIs/98TC7LnxlW8zpO871I jf0iAyIjq7oNSlmCfib7ZuMJgzaxXFgw9YwW0yktQU630inIApLDmVSVA748DBSJGFUr El51VC6bBr8FdwYGJsjDQdyfnSLXsHjotO0QBmCfJX+IB++aNCJufdf+lOw15BIzxAmi mgqokthRz+qlQBLT5PCtO38iKMPh3K9alzvXfMdB3JRbg3EsRw26kTOxD0fvkF0qSuXq 1a7dhW86+6crk/w6kHh3dBkbuXPI5H79xjK9EdodDqeIaXMysy8VyjeHnnPC7tKUjzKT kmUQ== X-Gm-Message-State: AOPr4FVXKfOGdLYYRJdtuNegmA+Sz71hWLlo3PkpQBGKk3eUuD1rVXfLpGfAdq6N4rakvsUGJVNlso7bg8UFOw== X-Received: by 10.194.93.2 with SMTP id cq2mr30434406wjb.151.1463387719248; Mon, 16 May 2016 01:35:19 -0700 (PDT) MIME-Version: 1.0 Received: by 10.194.170.167 with HTTP; Mon, 16 May 2016 01:34:59 -0700 (PDT) In-Reply-To: References: Date: Mon, 16 May 2016 10:34:59 +0200 Message-ID: To: Dmitry Stogov Cc: Dan Ackroyd , "internals@lists.php.net" Content-Type: multipart/alternative; boundary=047d7bb04d482cc8de0532f181aa Subject: Re: [PHP-DEV] [RFC][VOTE] Closure from callable From: ocramius@gmail.com (Marco Pivetta) --047d7bb04d482cc8de0532f181aa Content-Type: text/plain; charset=UTF-8 On 16 May 2016 at 10:31, Dmitry Stogov wrote: > I'm sorry, I didn't follow the RFC discussion. > In general I like the idea, but why not to use Closure constructor? > > $f = new Closure("some_func"); > > would look more readable than > > $f = Closure::fromCallable("some_func"); > > Sorry, if this was already discussed before. > > Thanks. Dmitry. > Constructors can't be used as callbacks, so you wouldn't be able to map this operation without yet another level of indirection. A named constructor also leaves more space for later improvements, and is quite a bit more expressive. Marco Pivetta http://twitter.com/Ocramius http://ocramius.github.com/ --047d7bb04d482cc8de0532f181aa--