Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:29135 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 22219 invoked by uid 1010); 3 May 2007 07:34:34 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 22204 invoked from network); 3 May 2007 07:34:34 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 May 2007 07:34:34 -0000 Authentication-Results: pb1.pair.com smtp.mail=andrew@bramp.freeserve.co.uk; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=andrew@bramp.freeserve.co.uk; sender-id=unknown Received-SPF: error (pb1.pair.com: domain bramp.freeserve.co.uk from 212.159.14.212 cause and error) X-PHP-List-Original-Sender: andrew@bramp.freeserve.co.uk X-Host-Fingerprint: 212.159.14.212 ptb-relay01.plus.net Linux 2.4/2.6 Received: from [212.159.14.212] ([212.159.14.212:47925] helo=ptb-relay01.plus.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id CB/26-08359-98099364 for ; Thu, 03 May 2007 03:34:33 -0400 Received: from [80.229.232.206] (helo=Andrew) by ptb-relay01.plus.net with smtp (Exim) id 1HjVpe-0007r5-MA for internals@lists.php.net; Thu, 03 May 2007 08:34:30 +0100 Message-ID: <00a001c78d55$8362b810$0a00a8c0@Andrew> To: References: <82F935820ADAF34089CFF7E6C49655B4013F3D48@GTSPOST1.gts.dk> <35014.216.230.84.67.1178133032.squirrel@www.l-i-e.com> Date: Thu, 3 May 2007 08:34:41 +0100 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.3028 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028 Subject: Re: [PHP-DEV] While-else From: andrew@bramp.freeserve.co.uk ("Andrew Brampton") ----- Original Message ----- > 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!"; >> } >> ?> >> --------------------- I have wanted to use this kind of syntax a couple of times, for example: Otherwise I would write the above code as a while + a if. However I'm unsure if this syntax should be put into PHP, but I thought I'll just post a example of when I would use it. thanks Andrew