note 106719 deleted from control-structures.goto by salathe
| From: | salathe@php.net | Date: | Mon, 21 Sep 2020 14:43:02 +0000 |
| Subject: | note 106719 deleted from control-structures.goto by salathe | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-215287@lists.php.net to get a copy of this message | ||
Note Submitter: f at francislacroix dot info
----
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.