note 106719 added to control-structures.goto
| From: | f at francislacroix dot info | Date: | Wed, 30 Nov 2011 21:11:48 +0000 |
| Subject: | note 106719 added to control-structures.goto | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-184833@lists.php.net to get a copy of this message | ||
The goto operator CAN be evaluated with eval, provided the label is in the eval'd code:
<?php
a: eval("goto a;"); // undefined label 'a'
eval("a: goto a;"); // works
?>
It's because PHP does not consider the eval'd code, containing the label, to be in the
same "file" as the goto statement.
----
Server IP: 69.147.83.197
Probable Submitter: 66.46.85.195
----
Manual Page -- http://www.php.net/manual/en/control-structures.goto.php
Edit -- https://master.php.net/note/edit/106719
Del: integrated -- https://master.php.net/note/delete/106719/integrated
Del: useless -- https://master.php.net/note/delete/106719/useless
Del: bad code -- https://master.php.net/note/delete/106719/bad+code
Del: spam -- https://master.php.net/note/delete/106719/spam
Del: non-english -- https://master.php.net/note/delete/106719/non-english
Del: in docs -- https://master.php.net/note/delete/106719/in+docs
Del: other reasons-- https://master.php.net/note/delete/106719
Reject -- https://master.php.net/note/reject/106719
Search -- https://master.php.net/manage/user-notes.php