Re: [PHP-DEV] While-else

2007-05-12 Thread Paul Colomiets
Pelle Ravn Rosfeldt wrote: Python & Perl already have this function. So why not PHP? It could be very useful in an SQL query, if it doesn't return anything. in Python else clause is executed if while is not ended by break. So it makes sense when you searching for something: It can't be e

Re: [PHP-DEV] While-else

2007-05-03 Thread Oliver Block
Am Donnerstag, 3. Mai 2007 09:34 schrieb Andrew Brampton: > 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'; > } > ?> This example leaves me speechless.:) Regard, Olive

Re: [PHP-DEV] While-else

2007-05-03 Thread Richard Lynch
On Thu, May 3, 2007 2:34 am, 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 >>>

Re: [PHP-DEV] While-else

2007-05-03 Thread Robin Vickery
On 28/04/07, Pelle Ravn Rosfeldt <[EMAIL PROTECTED]> wrote: Hi there. 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: ---

Re: [PHP-DEV] While-else

2007-05-03 Thread 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 s

Re: [PHP-DEV] While-else

2007-05-03 Thread Sean Bright
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 <[EMAIL PRO

Re: [PHP-DEV] While-else

2007-05-03 Thread 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 o

Re: [PHP-DEV] While-else

2007-05-03 Thread 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 act

Re: [PHP-DEV] While-else

2007-05-02 Thread Richard Lynch
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: >

Re: [PHP-DEV] While-else

2007-04-28 Thread Oliver Block
Am Samstag, 28. April 2007 20:03 schrieb Pelle Ravn Rosfeldt: > Python & Perl already have this function. > It could be very useful in an SQL query, if it doesn't return anything. Perl: "There's always more than one way to do it." Best Regards, Oliver -- PHP Internals - PHP Runtime Developm

RE: [PHP-DEV] While-else

2007-04-28 Thread Pelle Ravn Rosfeldt
Ravn Rosfeldt > Cc: internals@lists.php.net > Subject: Re: [PHP-DEV] While-else > > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Pelle Ravn Rosfeldt wrote: > > Hi there. > > > > Is it possible to make a "while" with a "else"-statement in PHP6? &

RE: [PHP-DEV] While-else

2007-04-28 Thread Pelle Ravn Rosfeldt
-Original Message- From: Asbjørn Sloth Tønnesen [mailto:[EMAIL PROTECTED] Sent: 28. april 2007 20:11 To: Pelle Ravn Rosfeldt Cc: internals@lists.php.net Subject: Re: [PHP-DEV] While-else -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Pelle Ravn Rosfeldt wrote: > Hi there. > &

Re: [PHP-DEV] While-else

2007-04-28 Thread Asbjørn Sloth Tønnesen
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Pelle Ravn Rosfeldt wrote: > Hi there. > > 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. There's already