jeudi 23 mai 2019

What is the value function inside Laravel's Arr.php object?

with PHP 7.2.10 I am receiving an uncaught error for a function called value() within Arr.php in laravel.

I have tried searching the PHP.net manual it returns nothing for a function called value.

For example this function found in https://github.com/illuminate/support/blob/master/Arr.php what is value function?

    public static function first($array, callable $callback = null, $default = null)
    {
        if (is_null($callback)) {
            if (empty($array)) {
                return value($default);
            }
            foreach ($array as $item) {
                return $item;
            }
        }
        foreach ($array as $key => $value) {
            if (call_user_func($callback, $value, $key)) {
                return $value;
            }
        }
        return value($default);
    }



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire