RE: [PHP-DEV] While-else
| From: | Pelle Ravn Rosfeldt | Date: | Sat, 28 Apr 2007 18:42:04 +0000 |
| Subject: | RE: [PHP-DEV] While-else | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-29094@lists.php.net to get a copy of this message | ||
-----Original Message-----
From: Asbjørn Sloth Tønnesen [mailto:asbjorn@asbjorn.biz]
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.
>
> 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 for it:
> http://bugs.php.net/bug.php?id=26411
I see.
> Here's an example of what I mean:
> ---------------------
> <?
> $i = 1;
> while ($i <= 10) {
> echo $i++;
> } else {
> echo "The while couldn't be executed!";
> }
> ?>
> ---------------------
> Your example never enters the else part of the statement. A better
> example would be using $i = 11 or higher value.
Yeah. You are absolutely right! My example is just to show how is should look.
- --
Best regards
Asbjørn Sloth Tønnesen
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
iD8DBQFGM44gSViWlxucwuoRAlIrAJ9Xi5y7MkJCkNfW9lqtQ255D5uOWACeKNmU
bNnKnuzxJhozYwchyZlOVzw=
=CD+b
-----END PGP SIGNATURE-----