Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:29134 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 20488 invoked by uid 1010); 3 May 2007 07:29:33 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 20473 invoked from network); 3 May 2007 07:29:33 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 May 2007 07:29:33 -0000 X-Host-Fingerprint: 195.225.34.5 fw01.axit.nl Received: from [195.225.34.5] ([195.225.34.5:24019] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 5C/E5-08359-B5F89364 for ; Thu, 03 May 2007 03:29:32 -0400 Message-ID: <5C.E5.08359.B5F89364@pb1.pair.com> To: internals@lists.php.net References: <82F935820ADAF34089CFF7E6C49655B4013F3D48@GTSPOST1.gts.dk> <35014.216.230.84.67.1178133032.squirrel@www.l-i-e.com> Date: Thu, 3 May 2007 09:27:56 +0200 Lines: 64 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.3028 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028 X-RFC2646: Format=Flowed; Original X-Posted-By: 195.225.34.5 Subject: Re: [PHP-DEV] While-else From: r.korving@xit.nl ("Ron Korving") It can save you one if-statement, where the condition would be identical to the where condition. Example: if ($i <= 10) { while ($i <= 10) { $i++; } } else { echo "$i is more than 10\n"; } I personally hate overspecifications, and this is one situation where that's the case. So actually, I would like while-else support. Just my humble 2 futile cents of course. Regards, Ron ""Richard Lynch"" schreef in bericht news:35014.216.230.84.67.1178133032.squirrel@www.l-i-e.com... > On Sat, April 28, 2007 1:03 pm, Pelle Ravn Rosfeldt wrote: >> Is it possible to make a "while" with a "else"-statement in PHP6? >> I know that it's not the first time this subject is up, but my >> research >> shows that a lot of people miss it. Including me. >> >> Here's an example of what I mean: >> --------------------- >> > $i = 1; >> while ($i <= 10) { >> echo $i++; >> } else { >> echo "The while couldn't be executed!"; >> } >> ?> >> --------------------- > > So it executes after the last iteration? > > No. > > It must only execute if there were no iterations?... > > Maybe I'm just an old fart, but I don't like it... > > :-v > > -- > Some people have a "gift" link here. > Know what I want? > I want you to buy a CD from some indie artist. > http://cdbaby.com/browse/from/lynch > Yeah, I get a buck. So?