PHP5.3 new operator goto_PHP tutorial

WBOY
Release: 2016-07-13 17:45:38
Original
832 people have browsed it

goto
The goto operator can be used to jump to a specified location in the program. The target location can be marked with the target name followed by a colon. Goto in PHP has certain restrictions and can only jump within the same file and scope. This means that you cannot jump out of a function or class method, nor can you jump into another function. You also cannot jump into any loops or switch structures. Common usage is to break out of a loop or switch, which can replace multiple levels of break.
eg.
goto a;
echo 'Foo';

a:
echo 'Bar';
?> //bar
Note:
The goto operator is only available in PHP 5.3 and above.

Author "My PHP Road"

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/478651.htmlTechArticlegoto The goto operator can be used to jump to a specified location in the program. The target location can be marked with the target name followed by a colon. Goto in PHP has certain restrictions, it can only be used in the same document...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!