Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:88600 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 95267 invoked from network); 1 Oct 2015 10:49:01 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 1 Oct 2015 10:49:01 -0000 Authentication-Results: pb1.pair.com header.from=rowan.collins@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=rowan.collins@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.169 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 209.85.212.169 mail-wi0-f169.google.com Received: from [209.85.212.169] ([209.85.212.169:37887] helo=mail-wi0-f169.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A2/E3-04700-D9F0D065 for ; Thu, 01 Oct 2015 06:49:01 -0400 Received: by wicfx3 with SMTP id fx3so22272525wic.0 for ; Thu, 01 Oct 2015 03:48:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-type:content-transfer-encoding; bh=PiAOYCgoxKKkhGO/ZfxYfahA72M9xzrB8qa5rqtu8F0=; b=cb+5tQ+BVq2Risv/SWaE2V70UVMe6hBNWT2WU67GLg88Cr5OpDH1N351NNZkjvTQHA CBdH5qr+AHcmHWzSPIrIcRHeqSMMQizDIk19eOzeKHuV8lmAe2zdR6wVdRgQJ/x/9/EY ptPMja11FLdpcFLrKH719i+OQw/9gIfwBLQGB/4NIkGO/v+JZXx9yJwNv4VO9+fpKW9D bIE+j6RTxjrmOfE1VIWuNAT0ukytBQjvl7EKA37kvCod2jeGsnBnZ/OIt8Q2tsLcrNT2 hHlnBZ/bbreiGKLRy1kB1lSUkTHlGRnMhkuXOYvbRUjEMnOQe1FBijgIv2s4SmtTPYxK 5EWg== X-Received: by 10.180.230.197 with SMTP id ta5mr2467102wic.26.1443696537841; Thu, 01 Oct 2015 03:48:57 -0700 (PDT) Received: from [192.168.0.161] ([62.189.198.114]) by smtp.googlemail.com with ESMTPSA id fr10sm2512810wib.14.2015.10.01.03.48.56 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 01 Oct 2015 03:48:57 -0700 (PDT) To: Levi Morrison , PHP internals References: <5606D0EB.3060106@gmail.com> Message-ID: <560D0F94.8060009@gmail.com> Date: Thu, 1 Oct 2015 11:48:52 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Arrow function expressions in PHP From: rowan.collins@gmail.com (Rowan Collins) Levi Morrison wrote on 01/10/2015 04:06: > I'm going to ask everyone to stop saying that auto-closing is bad > unless they also provide a demonstration of why it was bad. Please see my e-mail from last night, or Rasmus's in the original thread. It is "bad" (or, controversial) because it is a fundamental change to PHP's scoping rules, which currently treat all variables denoted by "$foo" as local to the current function, without exception. > I'm also going to ask everyone to stop suggesting new syntax for > importing variables. If use() is a pain then auto-importing the used > variables is a good solution. If it's not a pain why are you > suggesting new syntax? Because the feature is being described as "short closures", or as a new syntax, so people are looking for ways to make closures shorter without changing the functionality. If auto-capture is the main feature you are interested in, and syntax just a by-product, then it might be sensible to make that clear. As a straw man, it would be possible to have auto-capture closures with no new syntax at all, e.g. function($x) use(*) { return $x * $y; } It's perfectly reasonable to want both a shorter syntax and a different capture behaviour; but it also seems perfectly reasonable to want a shorter syntax with the same functionality as the current one, just as we have with [] vs array(). Regards, -- Rowan Collins [IMSoP]