Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:29145 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 40579 invoked by uid 1010); 3 May 2007 12:36:05 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 40563 invoked from network); 3 May 2007 12:36:05 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 May 2007 12:36:05 -0000 Authentication-Results: pb1.pair.com smtp.mail=sean.bright@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=sean.bright@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 66.249.82.225 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: sean.bright@gmail.com X-Host-Fingerprint: 66.249.82.225 wx-out-0506.google.com Linux 2.4/2.6 Received: from [66.249.82.225] ([66.249.82.225:57406] helo=wx-out-0506.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 63/91-21311-337D9364 for ; Thu, 03 May 2007 08:36:04 -0400 Received: by wx-out-0506.google.com with SMTP id i27so486535wxd for ; Thu, 03 May 2007 05:36:01 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=svKHNt7rOu3XtvxTEGlo2D47GQ3EgwLFLGB1i5P8DBW4mmsIyYWVscEMOY8/zt12aWtTKsr/H4ZNGtZDww9d8Vh2QN8iYwLHRVwvzVfb48y97jCrBCXkkGxwppQZ9gunHoeWh+koIEzSm443yKLkhWRxE4DhiYrHdo140ozJqtM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=P3it+iQiGNVLr3Izn1KtfoF1M3Dl9HxndyVBBQZF2auRtERbUAJiLuwHkka2m+i6q/DhPitaB2qJ63MoEcerXdQ6RVQpFhMLLoxSLPZOj4r1RYGYRvsybDXoPljB6Nh97Menzyde8bwZxoAs0vSVhcjViwP4NqqmRq69tUFJV+k= Received: by 10.90.49.1 with SMTP id w1mr1602560agw.1178195760572; Thu, 03 May 2007 05:36:00 -0700 (PDT) Received: by 10.90.89.20 with HTTP; Thu, 3 May 2007 05:36:00 -0700 (PDT) Message-ID: <3792607a0705030536i7a3950dua1a1a583e3730535@mail.gmail.com> Date: Thu, 3 May 2007 08:36:00 -0400 To: internals@lists.php.net In-Reply-To: <00a001c78d55$8362b810$0a00a8c0@Andrew> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_15017_1771200.1178195760487" References: <82F935820ADAF34089CFF7E6C49655B4013F3D48@GTSPOST1.gts.dk> <35014.216.230.84.67.1178133032.squirrel@www.l-i-e.com> <00a001c78d55$8362b810$0a00a8c0@Andrew> Subject: Re: [PHP-DEV] While-else From: sean.bright@gmail.com ("Sean Bright") ------=_Part_15017_1771200.1178195760487 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline This fails the "Make PHP code easier to read" test I think. But it passes the "I'm a lazy programmer" test with flying colors! ;-) I mean seriously, what real value does this add to the language? Its just syntactic sugar to save yourself a few keystrokes. On 5/3/07, Andrew Brampton wrote: > > ----- 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: > while ($line = mysql_fetch_array(...)) { > echo $line; > } else { > echo 'Sorry no records'; > } > ?> > > 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 > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > ------=_Part_15017_1771200.1178195760487--