Re: Bug #1452 Updated: $i = $i++ fails
| From: | Jeff Morrow | Date: | Tue, 25 May 1999 23:59:24 +0000 |
| Subject: | Re: Bug #1452 Updated: $i = $i++ fails | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-6001@lists.php.net to get a copy of this message | ||
>In fact, if that loop hangs for you, than it succeeds doing what
>it's supposed to do. $i=$i++ is equivalent to an empty statement.
>Consult the documentation regarding what post-increment is to
>understand why.
The PHP documentation or more general coding-style documentation? Couldn't
find anything on the PHP site.
>You could do what you want by choosing any of the following:
>$i = ++$i; or
>$i++; or
>++$i;
I know that these all work, and I know the difference between pre and post
increment. It's only by chance that the failing construct got used in my
code. Just thought you might want to know, since PHP handles it
differently from C.
Jeff
--
PHP Development Mailing List http://www.php.net/
To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net
For help: php-dev-help@lists.php.net