note 90734 rejected from control-structures.do.while by thiago
| From: | thiago@php.net | Date: | Thu, 07 May 2009 12:33:38 +0000 |
| Subject: | note 90734 rejected from control-structures.do.while by thiago | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-154308@lists.php.net to get a copy of this message | ||
Note Submitter: npelov at croler dot net
----
Attention C programmers! PHP documentation compares do-while loop with C/C++ usage which is
completely opposite. A "forever" cycle in PHP is:
<?php
do{
//forever
}while(0);
?>
and the C/C++ "forever" cycle is:
do{
// forever
}while(1);
I wander why:
1. PHP do-while loop differs from C/C++ when PHP's syntax is C-like
2. Why there is no warning and no one posted a note about this yet.