note 75845 added to control-structures.switch
| From: | zzo38 at osu1 dot php dot net | Date: | Mon, 18 Jun 2007 18:51:58 +0000 |
| Subject: | note 75845 added to control-structures.switch | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-127659@lists.php.net to get a copy of this message | ||
There is no GOTO command in PHP, but you can do something similar like this:
<?php
function testfunction($x) {$label='';while(1){switch($label){
case '':
if($x==0) continue ($label='fail')*0+1;
case 'ok':
echo "ok\n";
case 'fail':
echo "fail\n";
return;
}}}
?>
----
Server IP: 66.207.199.35
Probable Submitter: 24.207.64.154
----
Manual Page -- http://www.php.net/manual/en/control-structures.switch.php
Edit -- https://master.php.net/note/edit/75845
Del: integrated -- https://master.php.net/note/delete/75845/integrated
Del: useless -- https://master.php.net/note/delete/75845/useless
Del: bad code -- https://master.php.net/note/delete/75845/bad+code
Del: spam -- https://master.php.net/note/delete/75845/spam
Del: non-english -- https://master.php.net/note/delete/75845/non-english
Del: in docs -- https://master.php.net/note/delete/75845/in+docs
Del: other reasons-- https://master.php.net/note/delete/75845
Reject -- https://master.php.net/note/reject/75845
Search -- https://master.php.net/manage/user-notes.php