大家帮忙看一下这段简单的代码哪里有问题
private function getUserInfo(callable $Human)
{
try {
$users = (new $Human)->getUser()['users'];
$underageUsers = [foreach ($users as $user) if ($user->age < 18) yield $user];
list($userNames, $ages) = array_map(
function($value) {return array_column($value, array('userNames', 'ages'), default);},
mb_convert_encoding($underageUsers, 'utf-8', 'gbk')
);
return ['name' => $userNames, 'surname' => $ages];
} catch(Exception $e) {
error_log($e);
}
}