Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:29146 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 53885 invoked by uid 1010); 3 May 2007 13:10:50 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 53869 invoked from network); 3 May 2007 13:10:50 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 May 2007 13:10:50 -0000 Authentication-Results: pb1.pair.com smtp.mail=addw@phcomp.co.uk; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=addw@phcomp.co.uk; sender-id=pass Received-SPF: pass (pb1.pair.com: domain phcomp.co.uk designates 213.152.38.186 as permitted sender) X-PHP-List-Original-Sender: addw@phcomp.co.uk X-Host-Fingerprint: 213.152.38.186 freshmint.phcomp.co.uk Linux 2.5 (sometimes 2.4) (4) Received: from [213.152.38.186] ([213.152.38.186:63688] helo=mint.phcomp.co.uk) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 57/D2-21311-75FD9364 for ; Thu, 03 May 2007 09:10:48 -0400 Received: from addw by mint.phcomp.co.uk with local (Exim 4.67) (envelope-from ) id 1Hjb52-0003l4-Qz; Thu, 03 May 2007 14:10:44 +0100 Date: Thu, 3 May 2007 14:10:44 +0100 To: Sean Bright , internals@lists.php.net Message-ID: <20070503131044.GL5393@mint.phcomp.co.uk> References: <82F935820ADAF34089CFF7E6C49655B4013F3D48@GTSPOST1.gts.dk> <35014.216.230.84.67.1178133032.squirrel@www.l-i-e.com> <00a001c78d55$8362b810$0a00a8c0@Andrew> <3792607a0705030536i7a3950dua1a1a583e3730535@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3792607a0705030536i7a3950dua1a1a583e3730535@mail.gmail.com> User-Agent: Mutt/1.4.1i Organization: Parliament Hill Computers Ltd Subject: Re: [PHP-DEV] While-else From: addw@phcomp.co.uk (Alain Williams) On Thu, May 03, 2007 at 08:36:00AM -0400, Sean Bright wrote: > 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. * Less code - smaller compiled code * Only do the test once, without the need of extra variables/... I wonder if this should also be done on foreach: foreach($someArray as $key => $value) { echo "key=$key value=$value\n"; } else { echo "someArray is empty"; } $someArray could have been a function call. Also should this happen with the alternative syntax: while($i <= 10) : echo $i++; else: echo "The while couldn't be executed!"; endwhile; -- Alain Williams Linux Consultant - Mail systems, Web sites, Networking, Programmer, IT Lecturer. +44 (0) 787 668 0256 http://www.phcomp.co.uk/ Parliament Hill Computers Ltd. Registration Information: http://www.phcomp.co.uk/contact.php #include