macros - Include code from different function in PHP -


i have library c i'm adapting php. there no macros in php, need similar. let me give quick example:

function check($test){    if($test == false) return; } 

and call such function inside few times:

function checks(){    check(0==1);    check(1==1);    ... } 

and i'd want checks function stop after first test. please note not i'm trying do, example can understand i'm looking for. return statement in "check" should make function "checks" return.

thanks in advance.

how this..,

<?php      function check($test) {         if($test == false) {             //do something..             exit();         }     }      function checks() {         check(1 == 1);         echo "1 done..</br>";         check(2 == 2);         echo "2 done..</br>";         check(0 == 0);         echo "3 done..</br>";         check(1 == 2);         echo "4 done..</br>";         check(1 == 0);         echo "5 done..</br>";         check(2 == 1);           echo "6 done..</br>";     }      checks(); ?> 

Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -