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

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 of

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

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 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 shows that a lot

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: ?php while ($line = mysql_fetch_array(...)) { echo $line; } else { echo 'Sorry no records'; } ? This example leaves me speechless.:) Regard, Oliver

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:

[PHP-DEV] While-else

2007-04-28 Thread Pelle Ravn Rosfeldt
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: - ? $i = 1; while ($i = 10) { echo $i++; }

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 a bug

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

RE: [PHP-DEV] While-else

2007-04-28 Thread Pelle Ravn Rosfeldt
: 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? I know that it's not the first time this subject is up, but my research shows that a lot of people miss

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 Development