example:
$my_var = 'some text'; $my_closure = function($variable_name) { //here some magic... $$variable_name = 'some other text'; }; $my_closure('my_var'); echo $my_var //-> 'some other text'; the only way I know now is by using compact() or use() in the closure declaration, but compact look like this extract($my_closure(compact('my_var'))); and use must be done when closure is declared so is not flexible.