ThomasJSmart
Programmer
- Sep 16, 2002
- 634
Is this possible?
the result i want when parent_function() is called is that only 'start' is echo'd, but that the child function forces the parent function to return before it can reach the 'end' echo.
i need this for plugin hooks in an application, i want to allow a plugin (the child function) the option to return a value without letting the parent function complete. ideally without having some checking method in the parent function that checks for some return var in the child function return.
thanks!
Thomas
site | / blog |
Code:
function parent_function(){
$data = 'middle';
echo 'start';
child_function($data);
echo 'end';
}
function child_function($data){
parent::return $data;
}
the result i want when parent_function() is called is that only 'start' is echo'd, but that the child function forces the parent function to return before it can reach the 'end' echo.
i need this for plugin hooks in an application, i want to allow a plugin (the child function) the option to return a value without letting the parent function complete. ideally without having some checking method in the parent function that checks for some return var in the child function return.
thanks!
Thomas
site | / blog |