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

> 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.

- --
Best regards
Asbjørn Sloth Tønnesen
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFGM44gSViWlxucwuoRAlIrAJ9Xi5y7MkJCkNfW9lqtQ255D5uOWACeKNmU
bNnKnuzxJhozYwchyZlOVzw=
=CD+b
-----END PGP SIGNATURE-----

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to