Can the call continue as a return, or can it be invoked?
In my loop, I have a callback that returns true or false.
Depending on the result, I have to continue or break my loop.
Now I want this step to be easier if possible. I'll return 'continue' or 'break' in my callback and it would be nice to say something like:
call($return) // $return => 'continue' or 'break'
Is it possible?
EDIT
In short form:
$return = $this->myCallback(...);
if ($return) { break; }
if (!$return) { continue; }
Instead, I want something like this:
$return = $this->myCallback(...);
call($return); // return contains 'continue' or 'break'
+3
source to share
2 answers