Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:101221 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 64000 invoked from network); 2 Dec 2017 20:08:33 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 2 Dec 2017 20:08:33 -0000 Authentication-Results: pb1.pair.com smtp.mail=enclaved@Safe-mail.net; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=enclaved@Safe-mail.net; sender-id=pass; domainkeys=good Received-SPF: pass (pb1.pair.com: domain Safe-mail.net designates 212.29.227.83 as permitted sender) DomainKey-Status: good X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: enclaved@Safe-mail.net X-Host-Fingerprint: 212.29.227.83 mango.safe-mail.net Received: from [212.29.227.83] ([212.29.227.83:43224] helo=mango.safe-mail.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 9F/C3-09988-B38032A5 for ; Sat, 02 Dec 2017 15:08:31 -0500 Received: by mango.safe-mail.net with Safe-mail (Exim 4.84) (envelope-from ) id 1eLE5F-0007RL-8p; Sat, 02 Dec 2017 15:08:21 -0500 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=N1-0105; d=Safe-mail.net; b=ywSuEX1pGXBM3Vb9zj3v+3aLVbZ6dLyBOAuclCpY/8FxdmoxD2IPW/T0UH8MVqo+ y336HE89wbwBlSzAgVoiNsf+LBCu6DbeOgHvfpoIx4gwQF+OS5xLqVDyuB+ilAZ0 8WEv6nmdWfGTG5+J7p8ib2D+ByX2ihYjeOhhonGV7kQ=; Received: from pc ([109.63.246.156]) by Safe-mail.net with https Date: Sat, 2 Dec 2017 23:08:20 +0300 To: andreas@dqxtech.net CC: me@kelunik.com, cmbecker69@gmx.de, internals@lists.php.net X-SMType: Regular X-SMRef: N1M-VAr_zbFehN Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-SMSignature: 1P3LfvDvZB+zoyaxqpm/0iWxEdbCNYn8UMpzrJ8BYaP05piJQAYUDa0vQUGXKCGJ v0zQt7GaeCXmnmFVFl7FkNMS8ImGw5izUElhnN4LUnX2arZDUz0AlV4nqGw/jV73 YrJM3yQrt3fEwdukfGPOLubVvMgDBXdewMday010LVw= Subject: Re: [PHP-DEV] C++-like function-try-block proposal From: enclaved@Safe-mail.net ("Alexei Gerasimov") > It would blur the concept of a function body scope, and thus the mental model of how the language works. > E.g. are local variables and parameters shared between the try {} and the catch {} block? PHP documentation stresses it that the scope is always the entire function, i.e. it isn't like C/C++ where each compound statement makes up a new scope. The construct may indeed look alien to those who haven't had experience with C++, however, I believe this is a matter of a single clarification statement about scope, plus a tip like "just think of it as if wrapping curly braces are there around it, implicitly" (which is in fact the case), and soon you'll find yourself comfortable with it. > It would also mean that userland PHP parsers and IDEs need to support the syntax. True. However, this is true for pretty much any language change, and PHP has seen quite a few lately (typehints, anonymous classes.) I don't think we should be worried about changes _other_ projects would have to make to cope up with language evolution lest it becomes an (unnecessary and surrogate) obstacle. My vision is that if some company/group produces an IDE, it is but natural to expect them to be ready to adapt to language changes.