Error in php callback function continue

Source: Internet
Author: User
Callback Function: if it is a multiple of 3, the following code without callback function is not output for normal execution: {code ...} error message: Cannotbreakcontinue1levelinxxx. php callback function: returns a multiple of 3 and does not output

The following code does not use the callback function for normal execution:

Function number ($ n, $ m = '') {for ($ I = 0; $ I <$ n; $ I ++) {if ($ x % 3 = 0) {continue;} else {} echo $ I. "" ;}} number ("8"); function number2 ($ n, $ m = '') {for ($ I = 0; $ I <$ n; $ I ++) {$ m ($ I); echo $ I. "" ;}} function qudiao3 ($ x) {if ($ x % 3 = 0) {continue; // In the callback function, this place won't work} else {} number2 ("8", "qudiao3 ");

Error message: Cannot break/continue 1 level in xxx. php

Reply content:

Callback Function: returns a multiple of 3 instead of output.

The following code does not use the callback function for normal execution:

Function number ($ n, $ m = '') {for ($ I = 0; $ I <$ n; $ I ++) {if ($ x % 3 = 0) {continue;} else {} echo $ I. "" ;}} number ("8"); function number2 ($ n, $ m = '') {for ($ I = 0; $ I <$ n; $ I ++) {$ m ($ I); echo $ I. "" ;}} function qudiao3 ($ x) {if ($ x % 3 = 0) {continue; // In the callback function, this place won't work} else {} number2 ("8", "qudiao3 ");

Error message: Cannot break/continue 1 level in xxx. php

The last layer of the continue; can't jump without loops.

Php is a block scope. If you want to jump out, return directly.

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.