Re: Bug #1452 Updated: $i = $i++ fails
| From: | Rasmus Lerdorf | Date: | Tue, 25 May 1999 23:36:50 +0000 |
| Subject: | Re: Bug #1452 Updated: $i = $i++ fails | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-5998@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.
Uh?
$i = $i++;
This should be equivalent to doing:
$i=$i;
$i++;
at least from my understanding of what post-increment is supposed to do.
Try this C program:
int main() {
int i=0;
while(i < 50) {
printf("%d\n",i);
i = i++;
}
}
It is the equivalent to his example and it correctly counts from 0 to 49,
so I do believe the submitter of this bug is correct.
-Rasmus
--
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