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
- 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
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
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:
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
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
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:
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++;
}
-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
-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
-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
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
12 matches
Mail list logo