note 22463 added to control-structures.break
| From: | richard dot hyan at ptmc dot com | Date: | Wed, 19 Jun 2002 06:47:59 +0000 |
| Subject: | note 22463 added to control-structures.break | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-32001@lists.php.net to get a copy of this message | ||
'break' can be combined with empty cycle too.
in that case it's very handy when performing code with transaction-like character or
substituting a very long if statement:
//doing some initialization (opening/creating devices..etc)
//assigning `false' or error-code to result
do{
if(*assertained the process won't be successful*)break;
//some code here (getting some semi-result)
if(*assertained the process won't be successful*)break;
//succes, returning result/result-code
}while(0);
//disposing all we have prepared
--
http://www.php.net/manual/en/control-structures.break.php
http://master.php.net/manage/user-notes.php?action=edit+22463
http://master.php.net/manage/user-notes.php?action=delete+22463
http://master.php.net/manage/user-notes.php?action=reject+22463