Goto_PHP tutorial for new operators in PHP5.3

Source: Internet
Author: User
Added the goto operator in PHP5.3. The gotogoto operator can be used to jump to a specified position in the program. You can add a colon to the target location. The goto in PHP has certain restrictions. it can only be in the same file goto
The goto operator can be used to jump to a specified position in the program. You can add a colon to the target location. PHP has certain restrictions on goto. you can only jump to the same file and scope. that is to say, you cannot jump out of one function or class method, or jump to another function. You cannot jump into any loop or switch structure. A common usage is to jump out of a loop or switch, which can replace multiple levels of break.
Eg.
Goto;
Echo 'foo ';

A:
Echo 'bar ';
?> // Bar
Note:
The goto operator is only valid in PHP 5.3 and later versions.

Author: "My PHP path"

The http://www.bkjia.com/PHPjc/478651.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/478651.htmlTechArticlegoto goto operator can be used to jump to a specified position in the program. You can add a colon to the target location. The goto in PHP has certain restrictions. it can only be in the same file...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.