$hooks = function($meta, $type) use ($inspector, $instance)
{
if (isset($meta[$type]))
{
$run = array();
foreach ($meta[$type] as $method)
{
$hookMeta = $inspector->getMethodMeta($method);
if (in_array($method, $run) && !empty($hookMeta["@once"]))
{
continue;
}
$instance->$method();
$run[] = $method;
}
}
};
$hooks($methodMeta, "@before");
这个hooks function里面有一个use是怎么回事?
想不通。。。。望大师告知
Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
认证高级PHP讲师