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.