Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:101170 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 53730 invoked from network); 27 Nov 2017 18:41:23 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 27 Nov 2017 18:41:23 -0000 Authentication-Results: pb1.pair.com header.from=enclaved@Safe-mail.net; sender-id=pass; domainkeys=good Authentication-Results: pb1.pair.com smtp.mail=enclaved@Safe-mail.net; spf=pass; sender-id=pass 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:44790] helo=mango.safe-mail.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B7/6B-26862-25C5C1A5 for ; Mon, 27 Nov 2017 13:41:23 -0500 Received: by mango.safe-mail.net with Safe-mail (Exim 4.84) (envelope-from ) id 1eJOLH-0002MJ-FX; Mon, 27 Nov 2017 13:41:19 -0500 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=N1-0105; d=Safe-mail.net; b=HSx3NwFKpkSIYqhRbZGEPKFApzn2RV1C204ufGBCJlDDD3izUu2r9WNR2cxaf0ED CGvWV2dnHZNgOnZQc4H0dVSZp91F/QkDI7OdbbDoVqBqX36QzO1q4KVdn05XW6RP jB09uGbtjnIUKdvXhM/5PddiNa7eO2v6HqN4dlSCrmM=; Received: from pc ([109.63.246.156]) by Safe-mail.net with https Date: Mon, 27 Nov 2017 21:41:19 +0300 To: pollita@php.net CC: internals@lists.php.net X-SMType: Regular X-SMRef: N1M-lWkkMNmzxO Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-SMSignature: bME0lQagUvknZU6j2GOLu845YyPEBzE3dK4KZsSkBJjJsJoEnjxR0ggLW78EDy9X Jgr/W9ZipiIg1QZI64k5Jq4Tk4eDVgqTKc+8hRsv0sTacrtR6qhyKKJe+fQYsPiZ WYXaka+Fk8g+NegJqfgUVCeDUtFzTN+WCwQO7He+yxA= Subject: Re: [PHP-DEV] C++-like function-try-block proposal From: enclaved@Safe-mail.net ("Alexei Gerasimov") > > Since PHP is partially influenced by C++, I believe this syntax would be > > a meaningful step in making PHP a little bit more intuitively compatible > > with C++ practices, which may prove useful for people who come to PHP from > > the C++ world (such as myself.) The expected benefit is PHP becomes yet > > more familiar and comfortable for C++ programmers. > > > I'm not sure this statement is entirely accurate. PHP's fundamental > inspirations come from perl and C. It's OOP layer was inspired in > part from C++, but also from Java. Oh, I didn't mean to single C++ out, hence "partially". When I started with = PHP OOP not too long ago, I kinda expected that function-try-block construct = to work, for no real reason other than a hunch, and it didn't. So after taking = a look at the parser, I figured it wouldn't be a big deal to add it just as = syntactic sugar (Nikita pointed it out correctly that in C++ it was introduced = for the purpose of wrapping around initalizer lists.) After all it'd cost us = just one additional level of yacc grammar, i.e. nothing to worry about performance-wise. I could try to come up with a better and more realistic use case example for = it if I am ever allowed to make an actual RFC out of it. But still, perhaps = my best argument is that it is very cheap to implement, and may potentially = make code look neater. -Alexei