Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:49570 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 39780 invoked from network); 5 Sep 2010 12:30:43 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Sep 2010 12:30:43 -0000 Authentication-Results: pb1.pair.com smtp.mail=etienne@immomigsa.ch; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=colder@php.net; sender-id=unknown Received-SPF: error (pb1.pair.com: domain immomigsa.ch from 94.103.100.39 cause and error) X-PHP-List-Original-Sender: etienne@immomigsa.ch X-Host-Fingerprint: 94.103.100.39 mailer.immomigsa.ch Linux 2.6 Received: from [94.103.100.39] ([94.103.100.39:59583] helo=mailer.immomigsa.ch) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id DD/26-52399-F6D838C4 for ; Sun, 05 Sep 2010 08:30:40 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by mailer.immomigsa.ch (Postfix) with ESMTP id 68A3F4B60C1F for ; Sun, 5 Sep 2010 14:30:37 +0200 (CEST) X-Virus-Scanned: amavisd-new at immomigsa.ch Received: from mailer.immomigsa.ch ([127.0.0.1]) by localhost (mailer.immomigsa.ch [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ZFCUXTDTaGDY for ; Sun, 5 Sep 2010 14:30:37 +0200 (CEST) Received: from croustillant.local (79-158.105-92.cust.bluewin.ch [92.105.158.79]) by mailer.immomigsa.ch (Postfix) with ESMTPA id E2C2A4B60BD8 for ; Sun, 5 Sep 2010 14:30:36 +0200 (CEST) Received: by croustillant.local (Postfix, from userid 501) id EAFB412D7150; Sun, 5 Sep 2010 14:30:35 +0200 (CEST) Date: Sun, 5 Sep 2010 14:30:35 +0200 To: internals@lists.php.net Message-ID: <20100905123035.GA3759@croustillant.local> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) Subject: Re: [PHP-DEV] "or throw new" syntax From: colder@php.net (Etienne Kneuss) On Sep 05 14:19:16, Kalle Sommer Nielsen wrote: > Hi > > Is there any reason for we don't support expressions like: > > test() or throw new Exception('test() failed'); > > > If no, is there any argument against supporting such a syntax in trunk? Technically, it should be quite easy to have that available, but it might become tricky to handle cases like: foo(throw exception()); or even "throw throw throw new Foo;" ? :) Also, I consider "or die" patterns to be a bad idea, extending it for exceptions might make it a tad bit better, but I still find that bad because of i.e. non trivial precedence rules: include("foo") or throw new Exception("ads"); it will neither include "foo" nor throw any exception. > > -- > regards, > > Kalle Sommer Nielsen > kalle@php.net > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > -- Etienne Kneuss http://www.colder.ch