note 9709 added to break
| From: | anonymous at php2 dot chek dot com | Date: | Mon, 20 Nov 2000 16:47:28 +0000 |
| Subject: | note 9709 added to break | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-7917@lists.php.net to get a copy of this message | ||
No offense intended, but check the above code segment for convolution.
First, a "do { ... } while(0);" loop executes the bracketed code exactly once. This would
be equivalent to just writing the bracketed code inline. Why waste the parsing and processing
cycles?
Second, there is no such thing as "break[ing] out of an if [statement]".
The key word 'break' only applies to the bounding iterator.
In effect, you've provided a bogus iterator just to give the 'break' something to
break out of. This is bad coding practice and not something to teach the newbies!
http://www.php.net/manual/control-structures.break.php