<?phpfunction getMsgFnc2() { global $msg; return function() use (&$msg) { echo "Msg: {$msg}!<br/>\n"; };}$GLOBALS['msg'] = "Hello";$fnc = getMsgFnc2();$fnc();$GLOBALS['msg'] = "World";$fnc();