note 108217 added to control-structures.goto
| From: | roman4work at gmail dot com | Date: | Mon, 09 Apr 2012 03:36:16 +0000 |
| Subject: | note 108217 added to control-structures.goto | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-187018@lists.php.net to get a copy of this message | ||
since label executes all the time even if you don't use goto label;
<?php
if (false)
goto label
label :
echo "label triggered";
?>
Will output: label triggered
I use labels like this
<?php
...some code...
if (false) {
label1 :
echo "label 1 triggered";
}
if (false) {
label2 :
echo "label 2 triggered";
}
if (false) {
label3 :
echo "label 3 triggered";
}
?>
It will never output unless you use "goto <label>".
----
Server IP: 69.147.83.197
Probable Submitter: 99.52.118.86
----
Manual Page -- http://www.php.net/manual/en/control-structures.goto.php
Edit -- https://master.php.net/note/edit/108217
Del: integrated -- https://master.php.net/note/delete/108217/integrated
Del: useless -- https://master.php.net/note/delete/108217/useless
Del: bad code -- https://master.php.net/note/delete/108217/bad+code
Del: spam -- https://master.php.net/note/delete/108217/spam
Del: non-english -- https://master.php.net/note/delete/108217/non-english
Del: in docs -- https://master.php.net/note/delete/108217/in+docs
Del: other reasons-- https://master.php.net/note/delete/108217
Reject -- https://master.php.net/note/reject/108217
Search -- https://master.php.net/manage/user-notes.php