Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:93362 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 45173 invoked from network); 16 May 2016 20:12:40 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 May 2016 20:12:40 -0000 Authentication-Results: pb1.pair.com smtp.mail=danack@basereality.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=danack@basereality.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain basereality.com from 209.85.213.46 cause and error) X-PHP-List-Original-Sender: danack@basereality.com X-Host-Fingerprint: 209.85.213.46 mail-vk0-f46.google.com Received: from [209.85.213.46] ([209.85.213.46:36315] helo=mail-vk0-f46.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A2/31-35937-6B92A375 for ; Mon, 16 May 2016 16:12:39 -0400 Received: by mail-vk0-f46.google.com with SMTP id s184so227176582vkb.3 for ; Mon, 16 May 2016 13:12:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=basereality-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=IXkRgKNf4Ns61ff0p4Vo5ryLxUDtvCRrfN/DY9pfWPk=; b=N7/WkBMaMtPeGX1qhMrRqnryzd+CmRaRYQzuUrCXGaaOG7xbhlAudyfNQqjnmJ1JCn FHWOL9O/Uwy0Xkvcgpfjsp5TnlA/V1bH0MYTb9ePtaIOTZbn8UYTEd3b0BRi6IqNSOOs w4R2Z2/4h+8zkRn1lVVcgYPTR5X9V9Fpk7NL6ehria6D22eeWMC9zkHgJWDN+CBs4PdL iBdYi12sEnjLEg+S7PiWMh7MjsC1ffTqAJVFej4r3TXhU7+Mvwz7K3FEWFq9xowODZIz C084tEPCtqScc4T78C47u6pIDzi9Q6STpxRPfyk8rPfuGURT9HyWMesGbSAIjbLC6aJ7 KXyw== 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:date :message-id:subject:from:to:cc; bh=IXkRgKNf4Ns61ff0p4Vo5ryLxUDtvCRrfN/DY9pfWPk=; b=l5AzIY8o6tmqWPoX3V+XPVqO9uHBS18Cv8HojRjwhNmXdRJJhx+x3O/wMMzDc5jBNY JiHaV+sYSSlnN+FL6CyUbSkGJjnh61vQugRiRlLc+JtSiqzw3yUIgbCh2J9YqEFD4CoN nuVGtHNa8tyeJSULVQYi37jjD+nj1LKiuvMiEyzcj54PByDWAXIEjYigOtmnOe3QOWJK AZVAXALxX+7rt6Sk6Ux8HvZW8/+HBh++AL3cpac56DXPq0nw/Bcazs7e85R6yAxQpMtl cc0QWgOPvRWxxTxumFWCY8cOdDX0c43UafCBPlUBdkfMqZ+1xEMNMEtVOPxsUsoDlOMX tBFA== X-Gm-Message-State: AOPr4FUI4K2EkjbwLKbmFttAeix9DgKAYIbq0fD0OeHSj3OL1Ff7MI4HLYSb8Ysny6QqYMZzgcisXqoYlG9ZMg== MIME-Version: 1.0 X-Received: by 10.159.53.81 with SMTP id o75mr5792871uao.152.1463429555968; Mon, 16 May 2016 13:12:35 -0700 (PDT) Received: by 10.176.69.231 with HTTP; Mon, 16 May 2016 13:12:35 -0700 (PDT) X-Originating-IP: [2.96.81.225] In-Reply-To: References: Date: Mon, 16 May 2016 21:12:35 +0100 Message-ID: To: Dmitry Stogov Cc: "internals@lists.php.net" Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] [RFC][VOTE] Closure from callable From: danack@basereality.com (Dan Ackroyd) On 16 May 2016 at 09: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? > Hi Dmitry, Several small to medium sized reasons that make me think it's the best way. As Marco said, constructors cannot be passed as callbles, which for whatever reason both myself and he seem to encounter as a problem more than the average programmer. I had hoped to address this with this RFC: https://wiki.php.net/rfc/callableconstructors - but the feedback on that was massively negative so far. Second, it's quite likely we're going to have other ways of creating closures in the future. Having a default constructor that is 'special' above the other named constructors is a source of API sadness for me. > would look more readable than I actually seem to like named constructors more than default constructors, and am totally used to reading them. That may be down to my dislike of how constructors have special rules in being a little bit static, and also being instance methods at the same time. cheers Dan