Home  >  Article  >  Backend Development  >  大家帮忙看一下这段简单的代码哪里有有关问题

大家帮忙看一下这段简单的代码哪里有有关问题

WBOY
WBOYOriginal
2016-06-13 12:40:35869browse

大家帮忙看一下这段简单的代码哪里有问题

<br />
    private function getUserInfo(callable $Human)<br />
    {<br />
        try {<br />
            $users = (new $Human)->getUser()['users'];<br />
            $underageUsers = [foreach ($users as $user) if ($user->age < 18) yield $user];<br />
            <br />
            list($userNames, $ages) = array_map(<br />
                function($value) {return array_column($value, array('userNames', 'ages'), default);}, <br />
                mb_convert_encoding($underageUsers, 'utf-8', 'gbk')<br />
            );<br />
            <br />
            return ['name' => $userNames, 'surname' => $ages];<br />
        } catch(Exception $e) {<br />
            error_log($e);<br />
        }<br />
    }<br />

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn