PHPクロージャーと参照による引数の受け渡し

楽しみのために、PHPでクロージャーメカニズムを作成することにしました。 PHP 5.3にはそのようなメカニズムがあることを知っているので、私は強調します-純粋に学問的な興味からです。 そして、私の好奇心は(少なくとも私にとっては-誰かがすでにこれに対処できたかもしれない)結果をもたらしました-クロージャー自体に加えて、引数を渡す興味深い方法を得ました。



クロージャメカニズムは、このクラスで構成されます。



class closure { private static $l_closures = array(); public static function create($_scope, $_args, $_code) { $id = md5( "closure::create>" .serialize($_scope).$_args.$_code); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $header_code = '$scope=closure::scope("' .$id. '");' ; $header_end = 'unset($scope);' ; if ($_scope) { foreach ($_scope as $key => $value) { if ($key == 'scope' ) { $header_end = '$' .$key. '=&$scope["' .$key. '"];' ; } else { $header_code .= '$' .$key. '=&$scope["' .$key. '"];' ; } } } $header_code .= $header_end; $closure = array( "function" => create_function($_args, $header_code.$_code), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function bind($_scope, $_function) { $id = md5( "closure::bind>" .serialize($_scope).$_function); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $closure = array( "function" => create_function( '' , '$scope=closure::scope("' .$id. '");$debug=debug_backtrace();$args=$debug[0]["args"];call_user_func_array("' .$_function. '", array_merge($scope,$args));' ), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function scope($_id) { if (isset(self::$l_closures[$_id])) { return self::$l_closures[$_id][ "scope" ]; } return array(); } } * This source code was highlighted with Source Code Highlighter .



  1. class closure { private static $l_closures = array(); public static function create($_scope, $_args, $_code) { $id = md5( "closure::create>" .serialize($_scope).$_args.$_code); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $header_code = '$scope=closure::scope("' .$id. '");' ; $header_end = 'unset($scope);' ; if ($_scope) { foreach ($_scope as $key => $value) { if ($key == 'scope' ) { $header_end = '$' .$key. '=&$scope["' .$key. '"];' ; } else { $header_code .= '$' .$key. '=&$scope["' .$key. '"];' ; } } } $header_code .= $header_end; $closure = array( "function" => create_function($_args, $header_code.$_code), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function bind($_scope, $_function) { $id = md5( "closure::bind>" .serialize($_scope).$_function); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $closure = array( "function" => create_function( '' , '$scope=closure::scope("' .$id. '");$debug=debug_backtrace();$args=$debug[0]["args"];call_user_func_array("' .$_function. '", array_merge($scope,$args));' ), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function scope($_id) { if (isset(self::$l_closures[$_id])) { return self::$l_closures[$_id][ "scope" ]; } return array(); } } * This source code was highlighted with Source Code Highlighter .



  2. class closure { private static $l_closures = array(); public static function create($_scope, $_args, $_code) { $id = md5( "closure::create>" .serialize($_scope).$_args.$_code); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $header_code = '$scope=closure::scope("' .$id. '");' ; $header_end = 'unset($scope);' ; if ($_scope) { foreach ($_scope as $key => $value) { if ($key == 'scope' ) { $header_end = '$' .$key. '=&$scope["' .$key. '"];' ; } else { $header_code .= '$' .$key. '=&$scope["' .$key. '"];' ; } } } $header_code .= $header_end; $closure = array( "function" => create_function($_args, $header_code.$_code), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function bind($_scope, $_function) { $id = md5( "closure::bind>" .serialize($_scope).$_function); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $closure = array( "function" => create_function( '' , '$scope=closure::scope("' .$id. '");$debug=debug_backtrace();$args=$debug[0]["args"];call_user_func_array("' .$_function. '", array_merge($scope,$args));' ), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function scope($_id) { if (isset(self::$l_closures[$_id])) { return self::$l_closures[$_id][ "scope" ]; } return array(); } } * This source code was highlighted with Source Code Highlighter .



  3. class closure { private static $l_closures = array(); public static function create($_scope, $_args, $_code) { $id = md5( "closure::create>" .serialize($_scope).$_args.$_code); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $header_code = '$scope=closure::scope("' .$id. '");' ; $header_end = 'unset($scope);' ; if ($_scope) { foreach ($_scope as $key => $value) { if ($key == 'scope' ) { $header_end = '$' .$key. '=&$scope["' .$key. '"];' ; } else { $header_code .= '$' .$key. '=&$scope["' .$key. '"];' ; } } } $header_code .= $header_end; $closure = array( "function" => create_function($_args, $header_code.$_code), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function bind($_scope, $_function) { $id = md5( "closure::bind>" .serialize($_scope).$_function); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $closure = array( "function" => create_function( '' , '$scope=closure::scope("' .$id. '");$debug=debug_backtrace();$args=$debug[0]["args"];call_user_func_array("' .$_function. '", array_merge($scope,$args));' ), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function scope($_id) { if (isset(self::$l_closures[$_id])) { return self::$l_closures[$_id][ "scope" ]; } return array(); } } * This source code was highlighted with Source Code Highlighter .



  4. class closure { private static $l_closures = array(); public static function create($_scope, $_args, $_code) { $id = md5( "closure::create>" .serialize($_scope).$_args.$_code); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $header_code = '$scope=closure::scope("' .$id. '");' ; $header_end = 'unset($scope);' ; if ($_scope) { foreach ($_scope as $key => $value) { if ($key == 'scope' ) { $header_end = '$' .$key. '=&$scope["' .$key. '"];' ; } else { $header_code .= '$' .$key. '=&$scope["' .$key. '"];' ; } } } $header_code .= $header_end; $closure = array( "function" => create_function($_args, $header_code.$_code), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function bind($_scope, $_function) { $id = md5( "closure::bind>" .serialize($_scope).$_function); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $closure = array( "function" => create_function( '' , '$scope=closure::scope("' .$id. '");$debug=debug_backtrace();$args=$debug[0]["args"];call_user_func_array("' .$_function. '", array_merge($scope,$args));' ), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function scope($_id) { if (isset(self::$l_closures[$_id])) { return self::$l_closures[$_id][ "scope" ]; } return array(); } } * This source code was highlighted with Source Code Highlighter .



  5. class closure { private static $l_closures = array(); public static function create($_scope, $_args, $_code) { $id = md5( "closure::create>" .serialize($_scope).$_args.$_code); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $header_code = '$scope=closure::scope("' .$id. '");' ; $header_end = 'unset($scope);' ; if ($_scope) { foreach ($_scope as $key => $value) { if ($key == 'scope' ) { $header_end = '$' .$key. '=&$scope["' .$key. '"];' ; } else { $header_code .= '$' .$key. '=&$scope["' .$key. '"];' ; } } } $header_code .= $header_end; $closure = array( "function" => create_function($_args, $header_code.$_code), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function bind($_scope, $_function) { $id = md5( "closure::bind>" .serialize($_scope).$_function); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $closure = array( "function" => create_function( '' , '$scope=closure::scope("' .$id. '");$debug=debug_backtrace();$args=$debug[0]["args"];call_user_func_array("' .$_function. '", array_merge($scope,$args));' ), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function scope($_id) { if (isset(self::$l_closures[$_id])) { return self::$l_closures[$_id][ "scope" ]; } return array(); } } * This source code was highlighted with Source Code Highlighter .



  6. class closure { private static $l_closures = array(); public static function create($_scope, $_args, $_code) { $id = md5( "closure::create>" .serialize($_scope).$_args.$_code); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $header_code = '$scope=closure::scope("' .$id. '");' ; $header_end = 'unset($scope);' ; if ($_scope) { foreach ($_scope as $key => $value) { if ($key == 'scope' ) { $header_end = '$' .$key. '=&$scope["' .$key. '"];' ; } else { $header_code .= '$' .$key. '=&$scope["' .$key. '"];' ; } } } $header_code .= $header_end; $closure = array( "function" => create_function($_args, $header_code.$_code), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function bind($_scope, $_function) { $id = md5( "closure::bind>" .serialize($_scope).$_function); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $closure = array( "function" => create_function( '' , '$scope=closure::scope("' .$id. '");$debug=debug_backtrace();$args=$debug[0]["args"];call_user_func_array("' .$_function. '", array_merge($scope,$args));' ), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function scope($_id) { if (isset(self::$l_closures[$_id])) { return self::$l_closures[$_id][ "scope" ]; } return array(); } } * This source code was highlighted with Source Code Highlighter .



  7. class closure { private static $l_closures = array(); public static function create($_scope, $_args, $_code) { $id = md5( "closure::create>" .serialize($_scope).$_args.$_code); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $header_code = '$scope=closure::scope("' .$id. '");' ; $header_end = 'unset($scope);' ; if ($_scope) { foreach ($_scope as $key => $value) { if ($key == 'scope' ) { $header_end = '$' .$key. '=&$scope["' .$key. '"];' ; } else { $header_code .= '$' .$key. '=&$scope["' .$key. '"];' ; } } } $header_code .= $header_end; $closure = array( "function" => create_function($_args, $header_code.$_code), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function bind($_scope, $_function) { $id = md5( "closure::bind>" .serialize($_scope).$_function); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $closure = array( "function" => create_function( '' , '$scope=closure::scope("' .$id. '");$debug=debug_backtrace();$args=$debug[0]["args"];call_user_func_array("' .$_function. '", array_merge($scope,$args));' ), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function scope($_id) { if (isset(self::$l_closures[$_id])) { return self::$l_closures[$_id][ "scope" ]; } return array(); } } * This source code was highlighted with Source Code Highlighter .



  8. class closure { private static $l_closures = array(); public static function create($_scope, $_args, $_code) { $id = md5( "closure::create>" .serialize($_scope).$_args.$_code); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $header_code = '$scope=closure::scope("' .$id. '");' ; $header_end = 'unset($scope);' ; if ($_scope) { foreach ($_scope as $key => $value) { if ($key == 'scope' ) { $header_end = '$' .$key. '=&$scope["' .$key. '"];' ; } else { $header_code .= '$' .$key. '=&$scope["' .$key. '"];' ; } } } $header_code .= $header_end; $closure = array( "function" => create_function($_args, $header_code.$_code), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function bind($_scope, $_function) { $id = md5( "closure::bind>" .serialize($_scope).$_function); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $closure = array( "function" => create_function( '' , '$scope=closure::scope("' .$id. '");$debug=debug_backtrace();$args=$debug[0]["args"];call_user_func_array("' .$_function. '", array_merge($scope,$args));' ), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function scope($_id) { if (isset(self::$l_closures[$_id])) { return self::$l_closures[$_id][ "scope" ]; } return array(); } } * This source code was highlighted with Source Code Highlighter .



  9. class closure { private static $l_closures = array(); public static function create($_scope, $_args, $_code) { $id = md5( "closure::create>" .serialize($_scope).$_args.$_code); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $header_code = '$scope=closure::scope("' .$id. '");' ; $header_end = 'unset($scope);' ; if ($_scope) { foreach ($_scope as $key => $value) { if ($key == 'scope' ) { $header_end = '$' .$key. '=&$scope["' .$key. '"];' ; } else { $header_code .= '$' .$key. '=&$scope["' .$key. '"];' ; } } } $header_code .= $header_end; $closure = array( "function" => create_function($_args, $header_code.$_code), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function bind($_scope, $_function) { $id = md5( "closure::bind>" .serialize($_scope).$_function); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $closure = array( "function" => create_function( '' , '$scope=closure::scope("' .$id. '");$debug=debug_backtrace();$args=$debug[0]["args"];call_user_func_array("' .$_function. '", array_merge($scope,$args));' ), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function scope($_id) { if (isset(self::$l_closures[$_id])) { return self::$l_closures[$_id][ "scope" ]; } return array(); } } * This source code was highlighted with Source Code Highlighter .



  10. class closure { private static $l_closures = array(); public static function create($_scope, $_args, $_code) { $id = md5( "closure::create>" .serialize($_scope).$_args.$_code); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $header_code = '$scope=closure::scope("' .$id. '");' ; $header_end = 'unset($scope);' ; if ($_scope) { foreach ($_scope as $key => $value) { if ($key == 'scope' ) { $header_end = '$' .$key. '=&$scope["' .$key. '"];' ; } else { $header_code .= '$' .$key. '=&$scope["' .$key. '"];' ; } } } $header_code .= $header_end; $closure = array( "function" => create_function($_args, $header_code.$_code), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function bind($_scope, $_function) { $id = md5( "closure::bind>" .serialize($_scope).$_function); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $closure = array( "function" => create_function( '' , '$scope=closure::scope("' .$id. '");$debug=debug_backtrace();$args=$debug[0]["args"];call_user_func_array("' .$_function. '", array_merge($scope,$args));' ), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function scope($_id) { if (isset(self::$l_closures[$_id])) { return self::$l_closures[$_id][ "scope" ]; } return array(); } } * This source code was highlighted with Source Code Highlighter .



  11. class closure { private static $l_closures = array(); public static function create($_scope, $_args, $_code) { $id = md5( "closure::create>" .serialize($_scope).$_args.$_code); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $header_code = '$scope=closure::scope("' .$id. '");' ; $header_end = 'unset($scope);' ; if ($_scope) { foreach ($_scope as $key => $value) { if ($key == 'scope' ) { $header_end = '$' .$key. '=&$scope["' .$key. '"];' ; } else { $header_code .= '$' .$key. '=&$scope["' .$key. '"];' ; } } } $header_code .= $header_end; $closure = array( "function" => create_function($_args, $header_code.$_code), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function bind($_scope, $_function) { $id = md5( "closure::bind>" .serialize($_scope).$_function); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $closure = array( "function" => create_function( '' , '$scope=closure::scope("' .$id. '");$debug=debug_backtrace();$args=$debug[0]["args"];call_user_func_array("' .$_function. '", array_merge($scope,$args));' ), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function scope($_id) { if (isset(self::$l_closures[$_id])) { return self::$l_closures[$_id][ "scope" ]; } return array(); } } * This source code was highlighted with Source Code Highlighter .



  12. class closure { private static $l_closures = array(); public static function create($_scope, $_args, $_code) { $id = md5( "closure::create>" .serialize($_scope).$_args.$_code); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $header_code = '$scope=closure::scope("' .$id. '");' ; $header_end = 'unset($scope);' ; if ($_scope) { foreach ($_scope as $key => $value) { if ($key == 'scope' ) { $header_end = '$' .$key. '=&$scope["' .$key. '"];' ; } else { $header_code .= '$' .$key. '=&$scope["' .$key. '"];' ; } } } $header_code .= $header_end; $closure = array( "function" => create_function($_args, $header_code.$_code), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function bind($_scope, $_function) { $id = md5( "closure::bind>" .serialize($_scope).$_function); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $closure = array( "function" => create_function( '' , '$scope=closure::scope("' .$id. '");$debug=debug_backtrace();$args=$debug[0]["args"];call_user_func_array("' .$_function. '", array_merge($scope,$args));' ), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function scope($_id) { if (isset(self::$l_closures[$_id])) { return self::$l_closures[$_id][ "scope" ]; } return array(); } } * This source code was highlighted with Source Code Highlighter .



  13. class closure { private static $l_closures = array(); public static function create($_scope, $_args, $_code) { $id = md5( "closure::create>" .serialize($_scope).$_args.$_code); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $header_code = '$scope=closure::scope("' .$id. '");' ; $header_end = 'unset($scope);' ; if ($_scope) { foreach ($_scope as $key => $value) { if ($key == 'scope' ) { $header_end = '$' .$key. '=&$scope["' .$key. '"];' ; } else { $header_code .= '$' .$key. '=&$scope["' .$key. '"];' ; } } } $header_code .= $header_end; $closure = array( "function" => create_function($_args, $header_code.$_code), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function bind($_scope, $_function) { $id = md5( "closure::bind>" .serialize($_scope).$_function); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $closure = array( "function" => create_function( '' , '$scope=closure::scope("' .$id. '");$debug=debug_backtrace();$args=$debug[0]["args"];call_user_func_array("' .$_function. '", array_merge($scope,$args));' ), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function scope($_id) { if (isset(self::$l_closures[$_id])) { return self::$l_closures[$_id][ "scope" ]; } return array(); } } * This source code was highlighted with Source Code Highlighter .



  14. class closure { private static $l_closures = array(); public static function create($_scope, $_args, $_code) { $id = md5( "closure::create>" .serialize($_scope).$_args.$_code); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $header_code = '$scope=closure::scope("' .$id. '");' ; $header_end = 'unset($scope);' ; if ($_scope) { foreach ($_scope as $key => $value) { if ($key == 'scope' ) { $header_end = '$' .$key. '=&$scope["' .$key. '"];' ; } else { $header_code .= '$' .$key. '=&$scope["' .$key. '"];' ; } } } $header_code .= $header_end; $closure = array( "function" => create_function($_args, $header_code.$_code), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function bind($_scope, $_function) { $id = md5( "closure::bind>" .serialize($_scope).$_function); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $closure = array( "function" => create_function( '' , '$scope=closure::scope("' .$id. '");$debug=debug_backtrace();$args=$debug[0]["args"];call_user_func_array("' .$_function. '", array_merge($scope,$args));' ), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function scope($_id) { if (isset(self::$l_closures[$_id])) { return self::$l_closures[$_id][ "scope" ]; } return array(); } } * This source code was highlighted with Source Code Highlighter .



  15. class closure { private static $l_closures = array(); public static function create($_scope, $_args, $_code) { $id = md5( "closure::create>" .serialize($_scope).$_args.$_code); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $header_code = '$scope=closure::scope("' .$id. '");' ; $header_end = 'unset($scope);' ; if ($_scope) { foreach ($_scope as $key => $value) { if ($key == 'scope' ) { $header_end = '$' .$key. '=&$scope["' .$key. '"];' ; } else { $header_code .= '$' .$key. '=&$scope["' .$key. '"];' ; } } } $header_code .= $header_end; $closure = array( "function" => create_function($_args, $header_code.$_code), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function bind($_scope, $_function) { $id = md5( "closure::bind>" .serialize($_scope).$_function); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $closure = array( "function" => create_function( '' , '$scope=closure::scope("' .$id. '");$debug=debug_backtrace();$args=$debug[0]["args"];call_user_func_array("' .$_function. '", array_merge($scope,$args));' ), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function scope($_id) { if (isset(self::$l_closures[$_id])) { return self::$l_closures[$_id][ "scope" ]; } return array(); } } * This source code was highlighted with Source Code Highlighter .



  16. class closure { private static $l_closures = array(); public static function create($_scope, $_args, $_code) { $id = md5( "closure::create>" .serialize($_scope).$_args.$_code); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $header_code = '$scope=closure::scope("' .$id. '");' ; $header_end = 'unset($scope);' ; if ($_scope) { foreach ($_scope as $key => $value) { if ($key == 'scope' ) { $header_end = '$' .$key. '=&$scope["' .$key. '"];' ; } else { $header_code .= '$' .$key. '=&$scope["' .$key. '"];' ; } } } $header_code .= $header_end; $closure = array( "function" => create_function($_args, $header_code.$_code), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function bind($_scope, $_function) { $id = md5( "closure::bind>" .serialize($_scope).$_function); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $closure = array( "function" => create_function( '' , '$scope=closure::scope("' .$id. '");$debug=debug_backtrace();$args=$debug[0]["args"];call_user_func_array("' .$_function. '", array_merge($scope,$args));' ), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function scope($_id) { if (isset(self::$l_closures[$_id])) { return self::$l_closures[$_id][ "scope" ]; } return array(); } } * This source code was highlighted with Source Code Highlighter .



  17. class closure { private static $l_closures = array(); public static function create($_scope, $_args, $_code) { $id = md5( "closure::create>" .serialize($_scope).$_args.$_code); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $header_code = '$scope=closure::scope("' .$id. '");' ; $header_end = 'unset($scope);' ; if ($_scope) { foreach ($_scope as $key => $value) { if ($key == 'scope' ) { $header_end = '$' .$key. '=&$scope["' .$key. '"];' ; } else { $header_code .= '$' .$key. '=&$scope["' .$key. '"];' ; } } } $header_code .= $header_end; $closure = array( "function" => create_function($_args, $header_code.$_code), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function bind($_scope, $_function) { $id = md5( "closure::bind>" .serialize($_scope).$_function); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $closure = array( "function" => create_function( '' , '$scope=closure::scope("' .$id. '");$debug=debug_backtrace();$args=$debug[0]["args"];call_user_func_array("' .$_function. '", array_merge($scope,$args));' ), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function scope($_id) { if (isset(self::$l_closures[$_id])) { return self::$l_closures[$_id][ "scope" ]; } return array(); } } * This source code was highlighted with Source Code Highlighter .



  18. class closure { private static $l_closures = array(); public static function create($_scope, $_args, $_code) { $id = md5( "closure::create>" .serialize($_scope).$_args.$_code); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $header_code = '$scope=closure::scope("' .$id. '");' ; $header_end = 'unset($scope);' ; if ($_scope) { foreach ($_scope as $key => $value) { if ($key == 'scope' ) { $header_end = '$' .$key. '=&$scope["' .$key. '"];' ; } else { $header_code .= '$' .$key. '=&$scope["' .$key. '"];' ; } } } $header_code .= $header_end; $closure = array( "function" => create_function($_args, $header_code.$_code), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function bind($_scope, $_function) { $id = md5( "closure::bind>" .serialize($_scope).$_function); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $closure = array( "function" => create_function( '' , '$scope=closure::scope("' .$id. '");$debug=debug_backtrace();$args=$debug[0]["args"];call_user_func_array("' .$_function. '", array_merge($scope,$args));' ), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function scope($_id) { if (isset(self::$l_closures[$_id])) { return self::$l_closures[$_id][ "scope" ]; } return array(); } } * This source code was highlighted with Source Code Highlighter .



  19. class closure { private static $l_closures = array(); public static function create($_scope, $_args, $_code) { $id = md5( "closure::create>" .serialize($_scope).$_args.$_code); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $header_code = '$scope=closure::scope("' .$id. '");' ; $header_end = 'unset($scope);' ; if ($_scope) { foreach ($_scope as $key => $value) { if ($key == 'scope' ) { $header_end = '$' .$key. '=&$scope["' .$key. '"];' ; } else { $header_code .= '$' .$key. '=&$scope["' .$key. '"];' ; } } } $header_code .= $header_end; $closure = array( "function" => create_function($_args, $header_code.$_code), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function bind($_scope, $_function) { $id = md5( "closure::bind>" .serialize($_scope).$_function); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $closure = array( "function" => create_function( '' , '$scope=closure::scope("' .$id. '");$debug=debug_backtrace();$args=$debug[0]["args"];call_user_func_array("' .$_function. '", array_merge($scope,$args));' ), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function scope($_id) { if (isset(self::$l_closures[$_id])) { return self::$l_closures[$_id][ "scope" ]; } return array(); } } * This source code was highlighted with Source Code Highlighter .



  20. class closure { private static $l_closures = array(); public static function create($_scope, $_args, $_code) { $id = md5( "closure::create>" .serialize($_scope).$_args.$_code); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $header_code = '$scope=closure::scope("' .$id. '");' ; $header_end = 'unset($scope);' ; if ($_scope) { foreach ($_scope as $key => $value) { if ($key == 'scope' ) { $header_end = '$' .$key. '=&$scope["' .$key. '"];' ; } else { $header_code .= '$' .$key. '=&$scope["' .$key. '"];' ; } } } $header_code .= $header_end; $closure = array( "function" => create_function($_args, $header_code.$_code), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function bind($_scope, $_function) { $id = md5( "closure::bind>" .serialize($_scope).$_function); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $closure = array( "function" => create_function( '' , '$scope=closure::scope("' .$id. '");$debug=debug_backtrace();$args=$debug[0]["args"];call_user_func_array("' .$_function. '", array_merge($scope,$args));' ), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function scope($_id) { if (isset(self::$l_closures[$_id])) { return self::$l_closures[$_id][ "scope" ]; } return array(); } } * This source code was highlighted with Source Code Highlighter .



  21. class closure { private static $l_closures = array(); public static function create($_scope, $_args, $_code) { $id = md5( "closure::create>" .serialize($_scope).$_args.$_code); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $header_code = '$scope=closure::scope("' .$id. '");' ; $header_end = 'unset($scope);' ; if ($_scope) { foreach ($_scope as $key => $value) { if ($key == 'scope' ) { $header_end = '$' .$key. '=&$scope["' .$key. '"];' ; } else { $header_code .= '$' .$key. '=&$scope["' .$key. '"];' ; } } } $header_code .= $header_end; $closure = array( "function" => create_function($_args, $header_code.$_code), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function bind($_scope, $_function) { $id = md5( "closure::bind>" .serialize($_scope).$_function); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $closure = array( "function" => create_function( '' , '$scope=closure::scope("' .$id. '");$debug=debug_backtrace();$args=$debug[0]["args"];call_user_func_array("' .$_function. '", array_merge($scope,$args));' ), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function scope($_id) { if (isset(self::$l_closures[$_id])) { return self::$l_closures[$_id][ "scope" ]; } return array(); } } * This source code was highlighted with Source Code Highlighter .



  22. class closure { private static $l_closures = array(); public static function create($_scope, $_args, $_code) { $id = md5( "closure::create>" .serialize($_scope).$_args.$_code); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $header_code = '$scope=closure::scope("' .$id. '");' ; $header_end = 'unset($scope);' ; if ($_scope) { foreach ($_scope as $key => $value) { if ($key == 'scope' ) { $header_end = '$' .$key. '=&$scope["' .$key. '"];' ; } else { $header_code .= '$' .$key. '=&$scope["' .$key. '"];' ; } } } $header_code .= $header_end; $closure = array( "function" => create_function($_args, $header_code.$_code), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function bind($_scope, $_function) { $id = md5( "closure::bind>" .serialize($_scope).$_function); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $closure = array( "function" => create_function( '' , '$scope=closure::scope("' .$id. '");$debug=debug_backtrace();$args=$debug[0]["args"];call_user_func_array("' .$_function. '", array_merge($scope,$args));' ), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function scope($_id) { if (isset(self::$l_closures[$_id])) { return self::$l_closures[$_id][ "scope" ]; } return array(); } } * This source code was highlighted with Source Code Highlighter .



  23. class closure { private static $l_closures = array(); public static function create($_scope, $_args, $_code) { $id = md5( "closure::create>" .serialize($_scope).$_args.$_code); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $header_code = '$scope=closure::scope("' .$id. '");' ; $header_end = 'unset($scope);' ; if ($_scope) { foreach ($_scope as $key => $value) { if ($key == 'scope' ) { $header_end = '$' .$key. '=&$scope["' .$key. '"];' ; } else { $header_code .= '$' .$key. '=&$scope["' .$key. '"];' ; } } } $header_code .= $header_end; $closure = array( "function" => create_function($_args, $header_code.$_code), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function bind($_scope, $_function) { $id = md5( "closure::bind>" .serialize($_scope).$_function); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $closure = array( "function" => create_function( '' , '$scope=closure::scope("' .$id. '");$debug=debug_backtrace();$args=$debug[0]["args"];call_user_func_array("' .$_function. '", array_merge($scope,$args));' ), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function scope($_id) { if (isset(self::$l_closures[$_id])) { return self::$l_closures[$_id][ "scope" ]; } return array(); } } * This source code was highlighted with Source Code Highlighter .



  24. class closure { private static $l_closures = array(); public static function create($_scope, $_args, $_code) { $id = md5( "closure::create>" .serialize($_scope).$_args.$_code); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $header_code = '$scope=closure::scope("' .$id. '");' ; $header_end = 'unset($scope);' ; if ($_scope) { foreach ($_scope as $key => $value) { if ($key == 'scope' ) { $header_end = '$' .$key. '=&$scope["' .$key. '"];' ; } else { $header_code .= '$' .$key. '=&$scope["' .$key. '"];' ; } } } $header_code .= $header_end; $closure = array( "function" => create_function($_args, $header_code.$_code), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function bind($_scope, $_function) { $id = md5( "closure::bind>" .serialize($_scope).$_function); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $closure = array( "function" => create_function( '' , '$scope=closure::scope("' .$id. '");$debug=debug_backtrace();$args=$debug[0]["args"];call_user_func_array("' .$_function. '", array_merge($scope,$args));' ), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function scope($_id) { if (isset(self::$l_closures[$_id])) { return self::$l_closures[$_id][ "scope" ]; } return array(); } } * This source code was highlighted with Source Code Highlighter .



  25. class closure { private static $l_closures = array(); public static function create($_scope, $_args, $_code) { $id = md5( "closure::create>" .serialize($_scope).$_args.$_code); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $header_code = '$scope=closure::scope("' .$id. '");' ; $header_end = 'unset($scope);' ; if ($_scope) { foreach ($_scope as $key => $value) { if ($key == 'scope' ) { $header_end = '$' .$key. '=&$scope["' .$key. '"];' ; } else { $header_code .= '$' .$key. '=&$scope["' .$key. '"];' ; } } } $header_code .= $header_end; $closure = array( "function" => create_function($_args, $header_code.$_code), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function bind($_scope, $_function) { $id = md5( "closure::bind>" .serialize($_scope).$_function); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $closure = array( "function" => create_function( '' , '$scope=closure::scope("' .$id. '");$debug=debug_backtrace();$args=$debug[0]["args"];call_user_func_array("' .$_function. '", array_merge($scope,$args));' ), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function scope($_id) { if (isset(self::$l_closures[$_id])) { return self::$l_closures[$_id][ "scope" ]; } return array(); } } * This source code was highlighted with Source Code Highlighter .



  26. class closure { private static $l_closures = array(); public static function create($_scope, $_args, $_code) { $id = md5( "closure::create>" .serialize($_scope).$_args.$_code); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $header_code = '$scope=closure::scope("' .$id. '");' ; $header_end = 'unset($scope);' ; if ($_scope) { foreach ($_scope as $key => $value) { if ($key == 'scope' ) { $header_end = '$' .$key. '=&$scope["' .$key. '"];' ; } else { $header_code .= '$' .$key. '=&$scope["' .$key. '"];' ; } } } $header_code .= $header_end; $closure = array( "function" => create_function($_args, $header_code.$_code), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function bind($_scope, $_function) { $id = md5( "closure::bind>" .serialize($_scope).$_function); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $closure = array( "function" => create_function( '' , '$scope=closure::scope("' .$id. '");$debug=debug_backtrace();$args=$debug[0]["args"];call_user_func_array("' .$_function. '", array_merge($scope,$args));' ), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function scope($_id) { if (isset(self::$l_closures[$_id])) { return self::$l_closures[$_id][ "scope" ]; } return array(); } } * This source code was highlighted with Source Code Highlighter .



  27. class closure { private static $l_closures = array(); public static function create($_scope, $_args, $_code) { $id = md5( "closure::create>" .serialize($_scope).$_args.$_code); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $header_code = '$scope=closure::scope("' .$id. '");' ; $header_end = 'unset($scope);' ; if ($_scope) { foreach ($_scope as $key => $value) { if ($key == 'scope' ) { $header_end = '$' .$key. '=&$scope["' .$key. '"];' ; } else { $header_code .= '$' .$key. '=&$scope["' .$key. '"];' ; } } } $header_code .= $header_end; $closure = array( "function" => create_function($_args, $header_code.$_code), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function bind($_scope, $_function) { $id = md5( "closure::bind>" .serialize($_scope).$_function); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $closure = array( "function" => create_function( '' , '$scope=closure::scope("' .$id. '");$debug=debug_backtrace();$args=$debug[0]["args"];call_user_func_array("' .$_function. '", array_merge($scope,$args));' ), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function scope($_id) { if (isset(self::$l_closures[$_id])) { return self::$l_closures[$_id][ "scope" ]; } return array(); } } * This source code was highlighted with Source Code Highlighter .



  28. class closure { private static $l_closures = array(); public static function create($_scope, $_args, $_code) { $id = md5( "closure::create>" .serialize($_scope).$_args.$_code); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $header_code = '$scope=closure::scope("' .$id. '");' ; $header_end = 'unset($scope);' ; if ($_scope) { foreach ($_scope as $key => $value) { if ($key == 'scope' ) { $header_end = '$' .$key. '=&$scope["' .$key. '"];' ; } else { $header_code .= '$' .$key. '=&$scope["' .$key. '"];' ; } } } $header_code .= $header_end; $closure = array( "function" => create_function($_args, $header_code.$_code), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function bind($_scope, $_function) { $id = md5( "closure::bind>" .serialize($_scope).$_function); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $closure = array( "function" => create_function( '' , '$scope=closure::scope("' .$id. '");$debug=debug_backtrace();$args=$debug[0]["args"];call_user_func_array("' .$_function. '", array_merge($scope,$args));' ), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function scope($_id) { if (isset(self::$l_closures[$_id])) { return self::$l_closures[$_id][ "scope" ]; } return array(); } } * This source code was highlighted with Source Code Highlighter .



  29. class closure { private static $l_closures = array(); public static function create($_scope, $_args, $_code) { $id = md5( "closure::create>" .serialize($_scope).$_args.$_code); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $header_code = '$scope=closure::scope("' .$id. '");' ; $header_end = 'unset($scope);' ; if ($_scope) { foreach ($_scope as $key => $value) { if ($key == 'scope' ) { $header_end = '$' .$key. '=&$scope["' .$key. '"];' ; } else { $header_code .= '$' .$key. '=&$scope["' .$key. '"];' ; } } } $header_code .= $header_end; $closure = array( "function" => create_function($_args, $header_code.$_code), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function bind($_scope, $_function) { $id = md5( "closure::bind>" .serialize($_scope).$_function); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $closure = array( "function" => create_function( '' , '$scope=closure::scope("' .$id. '");$debug=debug_backtrace();$args=$debug[0]["args"];call_user_func_array("' .$_function. '", array_merge($scope,$args));' ), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function scope($_id) { if (isset(self::$l_closures[$_id])) { return self::$l_closures[$_id][ "scope" ]; } return array(); } } * This source code was highlighted with Source Code Highlighter .



  30. class closure { private static $l_closures = array(); public static function create($_scope, $_args, $_code) { $id = md5( "closure::create>" .serialize($_scope).$_args.$_code); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $header_code = '$scope=closure::scope("' .$id. '");' ; $header_end = 'unset($scope);' ; if ($_scope) { foreach ($_scope as $key => $value) { if ($key == 'scope' ) { $header_end = '$' .$key. '=&$scope["' .$key. '"];' ; } else { $header_code .= '$' .$key. '=&$scope["' .$key. '"];' ; } } } $header_code .= $header_end; $closure = array( "function" => create_function($_args, $header_code.$_code), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function bind($_scope, $_function) { $id = md5( "closure::bind>" .serialize($_scope).$_function); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $closure = array( "function" => create_function( '' , '$scope=closure::scope("' .$id. '");$debug=debug_backtrace();$args=$debug[0]["args"];call_user_func_array("' .$_function. '", array_merge($scope,$args));' ), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function scope($_id) { if (isset(self::$l_closures[$_id])) { return self::$l_closures[$_id][ "scope" ]; } return array(); } } * This source code was highlighted with Source Code Highlighter .



  31. class closure { private static $l_closures = array(); public static function create($_scope, $_args, $_code) { $id = md5( "closure::create>" .serialize($_scope).$_args.$_code); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $header_code = '$scope=closure::scope("' .$id. '");' ; $header_end = 'unset($scope);' ; if ($_scope) { foreach ($_scope as $key => $value) { if ($key == 'scope' ) { $header_end = '$' .$key. '=&$scope["' .$key. '"];' ; } else { $header_code .= '$' .$key. '=&$scope["' .$key. '"];' ; } } } $header_code .= $header_end; $closure = array( "function" => create_function($_args, $header_code.$_code), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function bind($_scope, $_function) { $id = md5( "closure::bind>" .serialize($_scope).$_function); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $closure = array( "function" => create_function( '' , '$scope=closure::scope("' .$id. '");$debug=debug_backtrace();$args=$debug[0]["args"];call_user_func_array("' .$_function. '", array_merge($scope,$args));' ), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function scope($_id) { if (isset(self::$l_closures[$_id])) { return self::$l_closures[$_id][ "scope" ]; } return array(); } } * This source code was highlighted with Source Code Highlighter .



  32. class closure { private static $l_closures = array(); public static function create($_scope, $_args, $_code) { $id = md5( "closure::create>" .serialize($_scope).$_args.$_code); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $header_code = '$scope=closure::scope("' .$id. '");' ; $header_end = 'unset($scope);' ; if ($_scope) { foreach ($_scope as $key => $value) { if ($key == 'scope' ) { $header_end = '$' .$key. '=&$scope["' .$key. '"];' ; } else { $header_code .= '$' .$key. '=&$scope["' .$key. '"];' ; } } } $header_code .= $header_end; $closure = array( "function" => create_function($_args, $header_code.$_code), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function bind($_scope, $_function) { $id = md5( "closure::bind>" .serialize($_scope).$_function); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $closure = array( "function" => create_function( '' , '$scope=closure::scope("' .$id. '");$debug=debug_backtrace();$args=$debug[0]["args"];call_user_func_array("' .$_function. '", array_merge($scope,$args));' ), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function scope($_id) { if (isset(self::$l_closures[$_id])) { return self::$l_closures[$_id][ "scope" ]; } return array(); } } * This source code was highlighted with Source Code Highlighter .



  33. class closure { private static $l_closures = array(); public static function create($_scope, $_args, $_code) { $id = md5( "closure::create>" .serialize($_scope).$_args.$_code); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $header_code = '$scope=closure::scope("' .$id. '");' ; $header_end = 'unset($scope);' ; if ($_scope) { foreach ($_scope as $key => $value) { if ($key == 'scope' ) { $header_end = '$' .$key. '=&$scope["' .$key. '"];' ; } else { $header_code .= '$' .$key. '=&$scope["' .$key. '"];' ; } } } $header_code .= $header_end; $closure = array( "function" => create_function($_args, $header_code.$_code), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function bind($_scope, $_function) { $id = md5( "closure::bind>" .serialize($_scope).$_function); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $closure = array( "function" => create_function( '' , '$scope=closure::scope("' .$id. '");$debug=debug_backtrace();$args=$debug[0]["args"];call_user_func_array("' .$_function. '", array_merge($scope,$args));' ), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function scope($_id) { if (isset(self::$l_closures[$_id])) { return self::$l_closures[$_id][ "scope" ]; } return array(); } } * This source code was highlighted with Source Code Highlighter .



  34. class closure { private static $l_closures = array(); public static function create($_scope, $_args, $_code) { $id = md5( "closure::create>" .serialize($_scope).$_args.$_code); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $header_code = '$scope=closure::scope("' .$id. '");' ; $header_end = 'unset($scope);' ; if ($_scope) { foreach ($_scope as $key => $value) { if ($key == 'scope' ) { $header_end = '$' .$key. '=&$scope["' .$key. '"];' ; } else { $header_code .= '$' .$key. '=&$scope["' .$key. '"];' ; } } } $header_code .= $header_end; $closure = array( "function" => create_function($_args, $header_code.$_code), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function bind($_scope, $_function) { $id = md5( "closure::bind>" .serialize($_scope).$_function); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $closure = array( "function" => create_function( '' , '$scope=closure::scope("' .$id. '");$debug=debug_backtrace();$args=$debug[0]["args"];call_user_func_array("' .$_function. '", array_merge($scope,$args));' ), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function scope($_id) { if (isset(self::$l_closures[$_id])) { return self::$l_closures[$_id][ "scope" ]; } return array(); } } * This source code was highlighted with Source Code Highlighter .



  35. class closure { private static $l_closures = array(); public static function create($_scope, $_args, $_code) { $id = md5( "closure::create>" .serialize($_scope).$_args.$_code); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $header_code = '$scope=closure::scope("' .$id. '");' ; $header_end = 'unset($scope);' ; if ($_scope) { foreach ($_scope as $key => $value) { if ($key == 'scope' ) { $header_end = '$' .$key. '=&$scope["' .$key. '"];' ; } else { $header_code .= '$' .$key. '=&$scope["' .$key. '"];' ; } } } $header_code .= $header_end; $closure = array( "function" => create_function($_args, $header_code.$_code), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function bind($_scope, $_function) { $id = md5( "closure::bind>" .serialize($_scope).$_function); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $closure = array( "function" => create_function( '' , '$scope=closure::scope("' .$id. '");$debug=debug_backtrace();$args=$debug[0]["args"];call_user_func_array("' .$_function. '", array_merge($scope,$args));' ), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function scope($_id) { if (isset(self::$l_closures[$_id])) { return self::$l_closures[$_id][ "scope" ]; } return array(); } } * This source code was highlighted with Source Code Highlighter .



  36. class closure { private static $l_closures = array(); public static function create($_scope, $_args, $_code) { $id = md5( "closure::create>" .serialize($_scope).$_args.$_code); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $header_code = '$scope=closure::scope("' .$id. '");' ; $header_end = 'unset($scope);' ; if ($_scope) { foreach ($_scope as $key => $value) { if ($key == 'scope' ) { $header_end = '$' .$key. '=&$scope["' .$key. '"];' ; } else { $header_code .= '$' .$key. '=&$scope["' .$key. '"];' ; } } } $header_code .= $header_end; $closure = array( "function" => create_function($_args, $header_code.$_code), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function bind($_scope, $_function) { $id = md5( "closure::bind>" .serialize($_scope).$_function); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $closure = array( "function" => create_function( '' , '$scope=closure::scope("' .$id. '");$debug=debug_backtrace();$args=$debug[0]["args"];call_user_func_array("' .$_function. '", array_merge($scope,$args));' ), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function scope($_id) { if (isset(self::$l_closures[$_id])) { return self::$l_closures[$_id][ "scope" ]; } return array(); } } * This source code was highlighted with Source Code Highlighter .



  37. class closure { private static $l_closures = array(); public static function create($_scope, $_args, $_code) { $id = md5( "closure::create>" .serialize($_scope).$_args.$_code); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $header_code = '$scope=closure::scope("' .$id. '");' ; $header_end = 'unset($scope);' ; if ($_scope) { foreach ($_scope as $key => $value) { if ($key == 'scope' ) { $header_end = '$' .$key. '=&$scope["' .$key. '"];' ; } else { $header_code .= '$' .$key. '=&$scope["' .$key. '"];' ; } } } $header_code .= $header_end; $closure = array( "function" => create_function($_args, $header_code.$_code), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function bind($_scope, $_function) { $id = md5( "closure::bind>" .serialize($_scope).$_function); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $closure = array( "function" => create_function( '' , '$scope=closure::scope("' .$id. '");$debug=debug_backtrace();$args=$debug[0]["args"];call_user_func_array("' .$_function. '", array_merge($scope,$args));' ), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function scope($_id) { if (isset(self::$l_closures[$_id])) { return self::$l_closures[$_id][ "scope" ]; } return array(); } } * This source code was highlighted with Source Code Highlighter .



  38. class closure { private static $l_closures = array(); public static function create($_scope, $_args, $_code) { $id = md5( "closure::create>" .serialize($_scope).$_args.$_code); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $header_code = '$scope=closure::scope("' .$id. '");' ; $header_end = 'unset($scope);' ; if ($_scope) { foreach ($_scope as $key => $value) { if ($key == 'scope' ) { $header_end = '$' .$key. '=&$scope["' .$key. '"];' ; } else { $header_code .= '$' .$key. '=&$scope["' .$key. '"];' ; } } } $header_code .= $header_end; $closure = array( "function" => create_function($_args, $header_code.$_code), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function bind($_scope, $_function) { $id = md5( "closure::bind>" .serialize($_scope).$_function); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $closure = array( "function" => create_function( '' , '$scope=closure::scope("' .$id. '");$debug=debug_backtrace();$args=$debug[0]["args"];call_user_func_array("' .$_function. '", array_merge($scope,$args));' ), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function scope($_id) { if (isset(self::$l_closures[$_id])) { return self::$l_closures[$_id][ "scope" ]; } return array(); } } * This source code was highlighted with Source Code Highlighter .



  39. class closure { private static $l_closures = array(); public static function create($_scope, $_args, $_code) { $id = md5( "closure::create>" .serialize($_scope).$_args.$_code); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $header_code = '$scope=closure::scope("' .$id. '");' ; $header_end = 'unset($scope);' ; if ($_scope) { foreach ($_scope as $key => $value) { if ($key == 'scope' ) { $header_end = '$' .$key. '=&$scope["' .$key. '"];' ; } else { $header_code .= '$' .$key. '=&$scope["' .$key. '"];' ; } } } $header_code .= $header_end; $closure = array( "function" => create_function($_args, $header_code.$_code), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function bind($_scope, $_function) { $id = md5( "closure::bind>" .serialize($_scope).$_function); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $closure = array( "function" => create_function( '' , '$scope=closure::scope("' .$id. '");$debug=debug_backtrace();$args=$debug[0]["args"];call_user_func_array("' .$_function. '", array_merge($scope,$args));' ), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function scope($_id) { if (isset(self::$l_closures[$_id])) { return self::$l_closures[$_id][ "scope" ]; } return array(); } } * This source code was highlighted with Source Code Highlighter .



  40. class closure { private static $l_closures = array(); public static function create($_scope, $_args, $_code) { $id = md5( "closure::create>" .serialize($_scope).$_args.$_code); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $header_code = '$scope=closure::scope("' .$id. '");' ; $header_end = 'unset($scope);' ; if ($_scope) { foreach ($_scope as $key => $value) { if ($key == 'scope' ) { $header_end = '$' .$key. '=&$scope["' .$key. '"];' ; } else { $header_code .= '$' .$key. '=&$scope["' .$key. '"];' ; } } } $header_code .= $header_end; $closure = array( "function" => create_function($_args, $header_code.$_code), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function bind($_scope, $_function) { $id = md5( "closure::bind>" .serialize($_scope).$_function); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $closure = array( "function" => create_function( '' , '$scope=closure::scope("' .$id. '");$debug=debug_backtrace();$args=$debug[0]["args"];call_user_func_array("' .$_function. '", array_merge($scope,$args));' ), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function scope($_id) { if (isset(self::$l_closures[$_id])) { return self::$l_closures[$_id][ "scope" ]; } return array(); } } * This source code was highlighted with Source Code Highlighter .



  41. class closure { private static $l_closures = array(); public static function create($_scope, $_args, $_code) { $id = md5( "closure::create>" .serialize($_scope).$_args.$_code); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $header_code = '$scope=closure::scope("' .$id. '");' ; $header_end = 'unset($scope);' ; if ($_scope) { foreach ($_scope as $key => $value) { if ($key == 'scope' ) { $header_end = '$' .$key. '=&$scope["' .$key. '"];' ; } else { $header_code .= '$' .$key. '=&$scope["' .$key. '"];' ; } } } $header_code .= $header_end; $closure = array( "function" => create_function($_args, $header_code.$_code), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function bind($_scope, $_function) { $id = md5( "closure::bind>" .serialize($_scope).$_function); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $closure = array( "function" => create_function( '' , '$scope=closure::scope("' .$id. '");$debug=debug_backtrace();$args=$debug[0]["args"];call_user_func_array("' .$_function. '", array_merge($scope,$args));' ), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function scope($_id) { if (isset(self::$l_closures[$_id])) { return self::$l_closures[$_id][ "scope" ]; } return array(); } } * This source code was highlighted with Source Code Highlighter .



  42. class closure { private static $l_closures = array(); public static function create($_scope, $_args, $_code) { $id = md5( "closure::create>" .serialize($_scope).$_args.$_code); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $header_code = '$scope=closure::scope("' .$id. '");' ; $header_end = 'unset($scope);' ; if ($_scope) { foreach ($_scope as $key => $value) { if ($key == 'scope' ) { $header_end = '$' .$key. '=&$scope["' .$key. '"];' ; } else { $header_code .= '$' .$key. '=&$scope["' .$key. '"];' ; } } } $header_code .= $header_end; $closure = array( "function" => create_function($_args, $header_code.$_code), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function bind($_scope, $_function) { $id = md5( "closure::bind>" .serialize($_scope).$_function); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $closure = array( "function" => create_function( '' , '$scope=closure::scope("' .$id. '");$debug=debug_backtrace();$args=$debug[0]["args"];call_user_func_array("' .$_function. '", array_merge($scope,$args));' ), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function scope($_id) { if (isset(self::$l_closures[$_id])) { return self::$l_closures[$_id][ "scope" ]; } return array(); } } * This source code was highlighted with Source Code Highlighter .



  43. class closure { private static $l_closures = array(); public static function create($_scope, $_args, $_code) { $id = md5( "closure::create>" .serialize($_scope).$_args.$_code); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $header_code = '$scope=closure::scope("' .$id. '");' ; $header_end = 'unset($scope);' ; if ($_scope) { foreach ($_scope as $key => $value) { if ($key == 'scope' ) { $header_end = '$' .$key. '=&$scope["' .$key. '"];' ; } else { $header_code .= '$' .$key. '=&$scope["' .$key. '"];' ; } } } $header_code .= $header_end; $closure = array( "function" => create_function($_args, $header_code.$_code), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function bind($_scope, $_function) { $id = md5( "closure::bind>" .serialize($_scope).$_function); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $closure = array( "function" => create_function( '' , '$scope=closure::scope("' .$id. '");$debug=debug_backtrace();$args=$debug[0]["args"];call_user_func_array("' .$_function. '", array_merge($scope,$args));' ), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function scope($_id) { if (isset(self::$l_closures[$_id])) { return self::$l_closures[$_id][ "scope" ]; } return array(); } } * This source code was highlighted with Source Code Highlighter .



  44. class closure { private static $l_closures = array(); public static function create($_scope, $_args, $_code) { $id = md5( "closure::create>" .serialize($_scope).$_args.$_code); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $header_code = '$scope=closure::scope("' .$id. '");' ; $header_end = 'unset($scope);' ; if ($_scope) { foreach ($_scope as $key => $value) { if ($key == 'scope' ) { $header_end = '$' .$key. '=&$scope["' .$key. '"];' ; } else { $header_code .= '$' .$key. '=&$scope["' .$key. '"];' ; } } } $header_code .= $header_end; $closure = array( "function" => create_function($_args, $header_code.$_code), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function bind($_scope, $_function) { $id = md5( "closure::bind>" .serialize($_scope).$_function); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $closure = array( "function" => create_function( '' , '$scope=closure::scope("' .$id. '");$debug=debug_backtrace();$args=$debug[0]["args"];call_user_func_array("' .$_function. '", array_merge($scope,$args));' ), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function scope($_id) { if (isset(self::$l_closures[$_id])) { return self::$l_closures[$_id][ "scope" ]; } return array(); } } * This source code was highlighted with Source Code Highlighter .



  45. class closure { private static $l_closures = array(); public static function create($_scope, $_args, $_code) { $id = md5( "closure::create>" .serialize($_scope).$_args.$_code); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $header_code = '$scope=closure::scope("' .$id. '");' ; $header_end = 'unset($scope);' ; if ($_scope) { foreach ($_scope as $key => $value) { if ($key == 'scope' ) { $header_end = '$' .$key. '=&$scope["' .$key. '"];' ; } else { $header_code .= '$' .$key. '=&$scope["' .$key. '"];' ; } } } $header_code .= $header_end; $closure = array( "function" => create_function($_args, $header_code.$_code), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function bind($_scope, $_function) { $id = md5( "closure::bind>" .serialize($_scope).$_function); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $closure = array( "function" => create_function( '' , '$scope=closure::scope("' .$id. '");$debug=debug_backtrace();$args=$debug[0]["args"];call_user_func_array("' .$_function. '", array_merge($scope,$args));' ), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function scope($_id) { if (isset(self::$l_closures[$_id])) { return self::$l_closures[$_id][ "scope" ]; } return array(); } } * This source code was highlighted with Source Code Highlighter .



  46. class closure { private static $l_closures = array(); public static function create($_scope, $_args, $_code) { $id = md5( "closure::create>" .serialize($_scope).$_args.$_code); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $header_code = '$scope=closure::scope("' .$id. '");' ; $header_end = 'unset($scope);' ; if ($_scope) { foreach ($_scope as $key => $value) { if ($key == 'scope' ) { $header_end = '$' .$key. '=&$scope["' .$key. '"];' ; } else { $header_code .= '$' .$key. '=&$scope["' .$key. '"];' ; } } } $header_code .= $header_end; $closure = array( "function" => create_function($_args, $header_code.$_code), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function bind($_scope, $_function) { $id = md5( "closure::bind>" .serialize($_scope).$_function); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $closure = array( "function" => create_function( '' , '$scope=closure::scope("' .$id. '");$debug=debug_backtrace();$args=$debug[0]["args"];call_user_func_array("' .$_function. '", array_merge($scope,$args));' ), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function scope($_id) { if (isset(self::$l_closures[$_id])) { return self::$l_closures[$_id][ "scope" ]; } return array(); } } * This source code was highlighted with Source Code Highlighter .



  47. class closure { private static $l_closures = array(); public static function create($_scope, $_args, $_code) { $id = md5( "closure::create>" .serialize($_scope).$_args.$_code); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $header_code = '$scope=closure::scope("' .$id. '");' ; $header_end = 'unset($scope);' ; if ($_scope) { foreach ($_scope as $key => $value) { if ($key == 'scope' ) { $header_end = '$' .$key. '=&$scope["' .$key. '"];' ; } else { $header_code .= '$' .$key. '=&$scope["' .$key. '"];' ; } } } $header_code .= $header_end; $closure = array( "function" => create_function($_args, $header_code.$_code), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function bind($_scope, $_function) { $id = md5( "closure::bind>" .serialize($_scope).$_function); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $closure = array( "function" => create_function( '' , '$scope=closure::scope("' .$id. '");$debug=debug_backtrace();$args=$debug[0]["args"];call_user_func_array("' .$_function. '", array_merge($scope,$args));' ), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function scope($_id) { if (isset(self::$l_closures[$_id])) { return self::$l_closures[$_id][ "scope" ]; } return array(); } } * This source code was highlighted with Source Code Highlighter .



  48. class closure { private static $l_closures = array(); public static function create($_scope, $_args, $_code) { $id = md5( "closure::create>" .serialize($_scope).$_args.$_code); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $header_code = '$scope=closure::scope("' .$id. '");' ; $header_end = 'unset($scope);' ; if ($_scope) { foreach ($_scope as $key => $value) { if ($key == 'scope' ) { $header_end = '$' .$key. '=&$scope["' .$key. '"];' ; } else { $header_code .= '$' .$key. '=&$scope["' .$key. '"];' ; } } } $header_code .= $header_end; $closure = array( "function" => create_function($_args, $header_code.$_code), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function bind($_scope, $_function) { $id = md5( "closure::bind>" .serialize($_scope).$_function); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $closure = array( "function" => create_function( '' , '$scope=closure::scope("' .$id. '");$debug=debug_backtrace();$args=$debug[0]["args"];call_user_func_array("' .$_function. '", array_merge($scope,$args));' ), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function scope($_id) { if (isset(self::$l_closures[$_id])) { return self::$l_closures[$_id][ "scope" ]; } return array(); } } * This source code was highlighted with Source Code Highlighter .



  49. class closure { private static $l_closures = array(); public static function create($_scope, $_args, $_code) { $id = md5( "closure::create>" .serialize($_scope).$_args.$_code); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $header_code = '$scope=closure::scope("' .$id. '");' ; $header_end = 'unset($scope);' ; if ($_scope) { foreach ($_scope as $key => $value) { if ($key == 'scope' ) { $header_end = '$' .$key. '=&$scope["' .$key. '"];' ; } else { $header_code .= '$' .$key. '=&$scope["' .$key. '"];' ; } } } $header_code .= $header_end; $closure = array( "function" => create_function($_args, $header_code.$_code), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function bind($_scope, $_function) { $id = md5( "closure::bind>" .serialize($_scope).$_function); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $closure = array( "function" => create_function( '' , '$scope=closure::scope("' .$id. '");$debug=debug_backtrace();$args=$debug[0]["args"];call_user_func_array("' .$_function. '", array_merge($scope,$args));' ), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function scope($_id) { if (isset(self::$l_closures[$_id])) { return self::$l_closures[$_id][ "scope" ]; } return array(); } } * This source code was highlighted with Source Code Highlighter .



  50. class closure { private static $l_closures = array(); public static function create($_scope, $_args, $_code) { $id = md5( "closure::create>" .serialize($_scope).$_args.$_code); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $header_code = '$scope=closure::scope("' .$id. '");' ; $header_end = 'unset($scope);' ; if ($_scope) { foreach ($_scope as $key => $value) { if ($key == 'scope' ) { $header_end = '$' .$key. '=&$scope["' .$key. '"];' ; } else { $header_code .= '$' .$key. '=&$scope["' .$key. '"];' ; } } } $header_code .= $header_end; $closure = array( "function" => create_function($_args, $header_code.$_code), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function bind($_scope, $_function) { $id = md5( "closure::bind>" .serialize($_scope).$_function); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $closure = array( "function" => create_function( '' , '$scope=closure::scope("' .$id. '");$debug=debug_backtrace();$args=$debug[0]["args"];call_user_func_array("' .$_function. '", array_merge($scope,$args));' ), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function scope($_id) { if (isset(self::$l_closures[$_id])) { return self::$l_closures[$_id][ "scope" ]; } return array(); } } * This source code was highlighted with Source Code Highlighter .



  51. class closure { private static $l_closures = array(); public static function create($_scope, $_args, $_code) { $id = md5( "closure::create>" .serialize($_scope).$_args.$_code); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $header_code = '$scope=closure::scope("' .$id. '");' ; $header_end = 'unset($scope);' ; if ($_scope) { foreach ($_scope as $key => $value) { if ($key == 'scope' ) { $header_end = '$' .$key. '=&$scope["' .$key. '"];' ; } else { $header_code .= '$' .$key. '=&$scope["' .$key. '"];' ; } } } $header_code .= $header_end; $closure = array( "function" => create_function($_args, $header_code.$_code), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function bind($_scope, $_function) { $id = md5( "closure::bind>" .serialize($_scope).$_function); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $closure = array( "function" => create_function( '' , '$scope=closure::scope("' .$id. '");$debug=debug_backtrace();$args=$debug[0]["args"];call_user_func_array("' .$_function. '", array_merge($scope,$args));' ), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function scope($_id) { if (isset(self::$l_closures[$_id])) { return self::$l_closures[$_id][ "scope" ]; } return array(); } } * This source code was highlighted with Source Code Highlighter .



  52. class closure { private static $l_closures = array(); public static function create($_scope, $_args, $_code) { $id = md5( "closure::create>" .serialize($_scope).$_args.$_code); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $header_code = '$scope=closure::scope("' .$id. '");' ; $header_end = 'unset($scope);' ; if ($_scope) { foreach ($_scope as $key => $value) { if ($key == 'scope' ) { $header_end = '$' .$key. '=&$scope["' .$key. '"];' ; } else { $header_code .= '$' .$key. '=&$scope["' .$key. '"];' ; } } } $header_code .= $header_end; $closure = array( "function" => create_function($_args, $header_code.$_code), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function bind($_scope, $_function) { $id = md5( "closure::bind>" .serialize($_scope).$_function); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $closure = array( "function" => create_function( '' , '$scope=closure::scope("' .$id. '");$debug=debug_backtrace();$args=$debug[0]["args"];call_user_func_array("' .$_function. '", array_merge($scope,$args));' ), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function scope($_id) { if (isset(self::$l_closures[$_id])) { return self::$l_closures[$_id][ "scope" ]; } return array(); } } * This source code was highlighted with Source Code Highlighter .



  53. class closure { private static $l_closures = array(); public static function create($_scope, $_args, $_code) { $id = md5( "closure::create>" .serialize($_scope).$_args.$_code); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $header_code = '$scope=closure::scope("' .$id. '");' ; $header_end = 'unset($scope);' ; if ($_scope) { foreach ($_scope as $key => $value) { if ($key == 'scope' ) { $header_end = '$' .$key. '=&$scope["' .$key. '"];' ; } else { $header_code .= '$' .$key. '=&$scope["' .$key. '"];' ; } } } $header_code .= $header_end; $closure = array( "function" => create_function($_args, $header_code.$_code), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function bind($_scope, $_function) { $id = md5( "closure::bind>" .serialize($_scope).$_function); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $closure = array( "function" => create_function( '' , '$scope=closure::scope("' .$id. '");$debug=debug_backtrace();$args=$debug[0]["args"];call_user_func_array("' .$_function. '", array_merge($scope,$args));' ), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function scope($_id) { if (isset(self::$l_closures[$_id])) { return self::$l_closures[$_id][ "scope" ]; } return array(); } } * This source code was highlighted with Source Code Highlighter .



  54. class closure { private static $l_closures = array(); public static function create($_scope, $_args, $_code) { $id = md5( "closure::create>" .serialize($_scope).$_args.$_code); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $header_code = '$scope=closure::scope("' .$id. '");' ; $header_end = 'unset($scope);' ; if ($_scope) { foreach ($_scope as $key => $value) { if ($key == 'scope' ) { $header_end = '$' .$key. '=&$scope["' .$key. '"];' ; } else { $header_code .= '$' .$key. '=&$scope["' .$key. '"];' ; } } } $header_code .= $header_end; $closure = array( "function" => create_function($_args, $header_code.$_code), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function bind($_scope, $_function) { $id = md5( "closure::bind>" .serialize($_scope).$_function); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $closure = array( "function" => create_function( '' , '$scope=closure::scope("' .$id. '");$debug=debug_backtrace();$args=$debug[0]["args"];call_user_func_array("' .$_function. '", array_merge($scope,$args));' ), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function scope($_id) { if (isset(self::$l_closures[$_id])) { return self::$l_closures[$_id][ "scope" ]; } return array(); } } * This source code was highlighted with Source Code Highlighter .



  55. class closure { private static $l_closures = array(); public static function create($_scope, $_args, $_code) { $id = md5( "closure::create>" .serialize($_scope).$_args.$_code); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $header_code = '$scope=closure::scope("' .$id. '");' ; $header_end = 'unset($scope);' ; if ($_scope) { foreach ($_scope as $key => $value) { if ($key == 'scope' ) { $header_end = '$' .$key. '=&$scope["' .$key. '"];' ; } else { $header_code .= '$' .$key. '=&$scope["' .$key. '"];' ; } } } $header_code .= $header_end; $closure = array( "function" => create_function($_args, $header_code.$_code), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function bind($_scope, $_function) { $id = md5( "closure::bind>" .serialize($_scope).$_function); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $closure = array( "function" => create_function( '' , '$scope=closure::scope("' .$id. '");$debug=debug_backtrace();$args=$debug[0]["args"];call_user_func_array("' .$_function. '", array_merge($scope,$args));' ), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function scope($_id) { if (isset(self::$l_closures[$_id])) { return self::$l_closures[$_id][ "scope" ]; } return array(); } } * This source code was highlighted with Source Code Highlighter .



  56. class closure { private static $l_closures = array(); public static function create($_scope, $_args, $_code) { $id = md5( "closure::create>" .serialize($_scope).$_args.$_code); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $header_code = '$scope=closure::scope("' .$id. '");' ; $header_end = 'unset($scope);' ; if ($_scope) { foreach ($_scope as $key => $value) { if ($key == 'scope' ) { $header_end = '$' .$key. '=&$scope["' .$key. '"];' ; } else { $header_code .= '$' .$key. '=&$scope["' .$key. '"];' ; } } } $header_code .= $header_end; $closure = array( "function" => create_function($_args, $header_code.$_code), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function bind($_scope, $_function) { $id = md5( "closure::bind>" .serialize($_scope).$_function); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $closure = array( "function" => create_function( '' , '$scope=closure::scope("' .$id. '");$debug=debug_backtrace();$args=$debug[0]["args"];call_user_func_array("' .$_function. '", array_merge($scope,$args));' ), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function scope($_id) { if (isset(self::$l_closures[$_id])) { return self::$l_closures[$_id][ "scope" ]; } return array(); } } * This source code was highlighted with Source Code Highlighter .



  57. class closure { private static $l_closures = array(); public static function create($_scope, $_args, $_code) { $id = md5( "closure::create>" .serialize($_scope).$_args.$_code); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $header_code = '$scope=closure::scope("' .$id. '");' ; $header_end = 'unset($scope);' ; if ($_scope) { foreach ($_scope as $key => $value) { if ($key == 'scope' ) { $header_end = '$' .$key. '=&$scope["' .$key. '"];' ; } else { $header_code .= '$' .$key. '=&$scope["' .$key. '"];' ; } } } $header_code .= $header_end; $closure = array( "function" => create_function($_args, $header_code.$_code), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function bind($_scope, $_function) { $id = md5( "closure::bind>" .serialize($_scope).$_function); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $closure = array( "function" => create_function( '' , '$scope=closure::scope("' .$id. '");$debug=debug_backtrace();$args=$debug[0]["args"];call_user_func_array("' .$_function. '", array_merge($scope,$args));' ), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function scope($_id) { if (isset(self::$l_closures[$_id])) { return self::$l_closures[$_id][ "scope" ]; } return array(); } } * This source code was highlighted with Source Code Highlighter .



  58. class closure { private static $l_closures = array(); public static function create($_scope, $_args, $_code) { $id = md5( "closure::create>" .serialize($_scope).$_args.$_code); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $header_code = '$scope=closure::scope("' .$id. '");' ; $header_end = 'unset($scope);' ; if ($_scope) { foreach ($_scope as $key => $value) { if ($key == 'scope' ) { $header_end = '$' .$key. '=&$scope["' .$key. '"];' ; } else { $header_code .= '$' .$key. '=&$scope["' .$key. '"];' ; } } } $header_code .= $header_end; $closure = array( "function" => create_function($_args, $header_code.$_code), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function bind($_scope, $_function) { $id = md5( "closure::bind>" .serialize($_scope).$_function); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $closure = array( "function" => create_function( '' , '$scope=closure::scope("' .$id. '");$debug=debug_backtrace();$args=$debug[0]["args"];call_user_func_array("' .$_function. '", array_merge($scope,$args));' ), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function scope($_id) { if (isset(self::$l_closures[$_id])) { return self::$l_closures[$_id][ "scope" ]; } return array(); } } * This source code was highlighted with Source Code Highlighter .



  59. class closure { private static $l_closures = array(); public static function create($_scope, $_args, $_code) { $id = md5( "closure::create>" .serialize($_scope).$_args.$_code); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $header_code = '$scope=closure::scope("' .$id. '");' ; $header_end = 'unset($scope);' ; if ($_scope) { foreach ($_scope as $key => $value) { if ($key == 'scope' ) { $header_end = '$' .$key. '=&$scope["' .$key. '"];' ; } else { $header_code .= '$' .$key. '=&$scope["' .$key. '"];' ; } } } $header_code .= $header_end; $closure = array( "function" => create_function($_args, $header_code.$_code), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function bind($_scope, $_function) { $id = md5( "closure::bind>" .serialize($_scope).$_function); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $closure = array( "function" => create_function( '' , '$scope=closure::scope("' .$id. '");$debug=debug_backtrace();$args=$debug[0]["args"];call_user_func_array("' .$_function. '", array_merge($scope,$args));' ), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function scope($_id) { if (isset(self::$l_closures[$_id])) { return self::$l_closures[$_id][ "scope" ]; } return array(); } } * This source code was highlighted with Source Code Highlighter .



  60. class closure { private static $l_closures = array(); public static function create($_scope, $_args, $_code) { $id = md5( "closure::create>" .serialize($_scope).$_args.$_code); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $header_code = '$scope=closure::scope("' .$id. '");' ; $header_end = 'unset($scope);' ; if ($_scope) { foreach ($_scope as $key => $value) { if ($key == 'scope' ) { $header_end = '$' .$key. '=&$scope["' .$key. '"];' ; } else { $header_code .= '$' .$key. '=&$scope["' .$key. '"];' ; } } } $header_code .= $header_end; $closure = array( "function" => create_function($_args, $header_code.$_code), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function bind($_scope, $_function) { $id = md5( "closure::bind>" .serialize($_scope).$_function); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $closure = array( "function" => create_function( '' , '$scope=closure::scope("' .$id. '");$debug=debug_backtrace();$args=$debug[0]["args"];call_user_func_array("' .$_function. '", array_merge($scope,$args));' ), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function scope($_id) { if (isset(self::$l_closures[$_id])) { return self::$l_closures[$_id][ "scope" ]; } return array(); } } * This source code was highlighted with Source Code Highlighter .



  61. class closure { private static $l_closures = array(); public static function create($_scope, $_args, $_code) { $id = md5( "closure::create>" .serialize($_scope).$_args.$_code); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $header_code = '$scope=closure::scope("' .$id. '");' ; $header_end = 'unset($scope);' ; if ($_scope) { foreach ($_scope as $key => $value) { if ($key == 'scope' ) { $header_end = '$' .$key. '=&$scope["' .$key. '"];' ; } else { $header_code .= '$' .$key. '=&$scope["' .$key. '"];' ; } } } $header_code .= $header_end; $closure = array( "function" => create_function($_args, $header_code.$_code), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function bind($_scope, $_function) { $id = md5( "closure::bind>" .serialize($_scope).$_function); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $closure = array( "function" => create_function( '' , '$scope=closure::scope("' .$id. '");$debug=debug_backtrace();$args=$debug[0]["args"];call_user_func_array("' .$_function. '", array_merge($scope,$args));' ), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function scope($_id) { if (isset(self::$l_closures[$_id])) { return self::$l_closures[$_id][ "scope" ]; } return array(); } } * This source code was highlighted with Source Code Highlighter .



class closure { private static $l_closures = array(); public static function create($_scope, $_args, $_code) { $id = md5( "closure::create>" .serialize($_scope).$_args.$_code); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $header_code = '$scope=closure::scope("' .$id. '");' ; $header_end = 'unset($scope);' ; if ($_scope) { foreach ($_scope as $key => $value) { if ($key == 'scope' ) { $header_end = '$' .$key. '=&$scope["' .$key. '"];' ; } else { $header_code .= '$' .$key. '=&$scope["' .$key. '"];' ; } } } $header_code .= $header_end; $closure = array( "function" => create_function($_args, $header_code.$_code), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function bind($_scope, $_function) { $id = md5( "closure::bind>" .serialize($_scope).$_function); if (isset(self::$l_closures[$id])) { print "exists<br>" ; return self::$l_closures[$id][ "function" ]; } print "create new<br>" ; $closure = array( "function" => create_function( '' , '$scope=closure::scope("' .$id. '");$debug=debug_backtrace();$args=$debug[0]["args"];call_user_func_array("' .$_function. '", array_merge($scope,$args));' ), "scope" => is_array($_scope) ? $_scope : array() ); self::$l_closures[$id] = $closure; return $closure[ "function" ]; } public static function scope($_id) { if (isset(self::$l_closures[$_id])) { return self::$l_closures[$_id][ "scope" ]; } return array(); } } * This source code was highlighted with Source Code Highlighter .







それ以上。 これが実際の動作です。







  1. 関数 outer1($ _ arg)
  2. {
  3. $ local_var = 70;
  4. 閉包を返す :: create(
  5. / * scope * / array( '_arg' =>&$ _ arg、 'local_var' =>&$ local_var)、
  6. / *引数* / '&$ _ inner_arg'
  7. / *コード* / 'print $ _arg。 ""。$ local_var。 ""。$ _ inner_arg; $ _arg = 110; $ _inner_arg = 120; '
  8. );
  9. }
  10. $ a = 50;
  11. $ inner1 = outer1(&$ a);
  12. $ inner1 = outer1(&$ a);
  13. $ inner1 = outer1(&$ a);
  14. $ ia = 90;
  15. $ inner1(&$ ia);
  16. print "" 。$ a。 "" 。$ ia。 "<br>" ;
  17. 関数 inner2($ _ arg、$ local_var、および$ _ inner_arg)
  18. {
  19. $ _argを出力します。 "" 。$ local_var。 "" 。$ _ inner_arg; $ _arg = 110; $ _inner_arg = 120;
  20. }
  21. 関数 outer2($ _ arg)
  22. {
  23. $ local_var = 70;
  24. 閉包を返す :: bind(
  25. / *スコープ* /配列(&$ _ arg、&$ local_var)、
  26. / *関数* / 'inner2'
  27. );
  28. }
  29. $ a = 50;
  30. $ inner2 = outer2(&$ a);
  31. $ inner2 = outer2(&$ a);
  32. $ inner2 = outer2(&$ a);
  33. $ ia = 90;
  34. $ inner2(&$ ia);
  35. print "" 。$ a。 "" 。$ ia。 "<br>" ;
*このソースコードは、 ソースコードハイライターで強調表示されました。




クロージャー:: createメソッドはcreate_functionと同じように見えます-最初にのみ、別のパラメーター、連想配列の形式の環境、そのキーが変数名($記号なし)であり、値がそれぞれの値に渡されます。



クロージャー::バインドは、変数の値とfu蒸に対して閉じられる関数を含む配列形式の環境を受け入れます。 関数は、最初に環境変数を取り、その後で呼び出される引数のみを取ります。



「新規作成」を印刷します。 「存在する」と印刷します。 各クロージャーが一度だけ作成されることを示すために導入されました。



PHP 5.3がすべてのホスティングサイトでまだタイトでない限り、このメカニズムを使用できます。



ここで、37〜39行目に注意してください。 明確にするために、別の例を作成します。







  1. 関数 f()
  2. {
  3. $ args = func_get_args();
  4. $ args [0] = 10;
  5. }
  6. $ a = 20;
  7. f(&$ a);
  8. 印刷$ "<br>" ;
  9. $ a = 20;
  10. call_user_func_array( 'f' 、配列(&$ a));
  11. 印刷$ "<br>" ;
*このソースコードは、 ソースコードハイライターで強調表示されました。




関数fの出口では、変数$ aの値は20になります-func_get_args関数は引数の配列ではなく、引数値の配列返します。 リンクが消え、ローカル変数を変更しました。



次の例を考えてみましょう。







  1. 関数 f()
  2. {
  3. $ debug = debug_backtrace();
  4. $ debug [0] [ "args" ] [0] = 10;
  5. }
  6. $ a = 20;
  7. f(&$ a);
  8. 印刷$ "<br>" ;
  9. $ a = 20;
  10. call_user_func_array( 'f' 、配列(&$ a));
  11. 印刷$ "<br>" ;
*このソースコードは、 ソースコードハイライターで強調表示されました。




例では10が出力されます。 期待していた! Debug_backtrace は引数自体を保存します 。 call_user_func_arrayは参照により値を渡すことができるため、







  1. call_user_func_array( 'f' 、配列(&$ a));
*このソースコードは、 ソースコードハイライターで強調表示されました。




また、$ 10を$ aに書き込みます。



私は誰かにとってこれが虐殺であることが判明することを完全に認めていますが、これを以前に知らず、このトピックで何かを見つけることができなかったという事実を考慮すると、これは他の人にとって役に立つかもしれません-厳しすぎないでください。



ご清聴ありがとうございました!



UPD#1 12/05/09



クロージャクラスのスコープメソッドは、次のように変更する必要があります。







  1. パブリック 静的 関数スコープ($ _ id)
  2. {
  3. $ result = array();
  4. if (isset(self :: $ l_closures [$ _ id]))
  5. {
  6. if (self :: $ l_closures [$ _ id] [ "scope" ])
  7. {
  8. foreach (self :: $ l_closures [$ _ id] [ "scope" ] as $ key => $ value)
  9. {
  10. $ result [$ key] =&self :: $ l_closures [$ _ id] [ "scope" ] [$ key];
  11. }
  12. }
  13. }
  14. return $ result;
  15. }
*このソースコードは、 ソースコードハイライターで強調表示されました。




変数への参照が唯一のものである場合、何らかの理由でPHPはそれを値自体に変換します。 ローカル変数は、参照によってではなく、値によって環境からすでに転送されますが、これは役に立ちません。 同じ修正例で







  1. 関数 inner2($ _ arg、$ local_var、および$ _ inner_arg)
  2. {
  3. $ local_var ++;
  4. $ _argを出力します。 "" 。$ local_var。 "" 。$ _ inner_arg; $ _arg = 110; $ _inner_arg = 120;
  5. }
  6. 関数 outer2($ _ arg)
  7. {
  8. $ local_var = 70;
  9. 閉包を返す :: bind(
  10. / *スコープ* /配列(&$ _ arg、&$ local_var)、
  11. / *関数* / 'inner2'
  12. );
  13. }
  14. $ a = 50;
  15. $ inner2 = outer2(&$ a);
  16. $ inner2 = outer2(&$ a);
  17. $ inner2 = outer2(&$ a);
  18. $ ia = 90;
  19. $ inner2(&$ ia);
  20. print "" 。$ a。 "" 。$ ia。 "<br>" ;
  21. $ inner2(&$ ia);
  22. print "" 。$ a。 "" 。$ ia。 "<br>" ;
*このソースコードは、 ソースコードハイライターで強調表示されました。




$ local_varに対してそれぞれ71と72を出力しますが、指定されたメソッドを変更しないと、両方の場合に71を出力します。



UPD#2 12/05/09



クラスの49行目に、 return call_user_func_arrayを記述する必要があります



All Articles