helpers/ArrayHelper.php
public static function getValue($array, $key, $default = null)
    {
        if ($key instanceof \Closure) {
            return $key($array, $default);
        } elseif (is_array($array)) {
            return isset($array[$key]) || array_key_exists($key, $array) ? $array[$key] : $default;
        } else {
            return $array->$key;
        }
    }
public static function getValue($array, $key, $default = null)
    {
        if ($key instanceof \Closure) {
            return $key($array, $default);
        } elseif (is_array($array)) {
            return isset($array[$key]) || array_key_exists($key, $array) ? $array[$key] : $default;
        } else {
            return $array->$key;
        }
    }
public static function getValue ( $ array , $ key , $ default = null ) { if ( $ key instanceof \ Closure ) { return $ key ( $ array , $ default ) ; } elseif ( is_array ( $ array ) ) { return isset ( $ array [ $ key ] ) || array_key_exists ( $ key , $ array ) ? $ array [ $ key ] : $ default ; } else { return $ array -> $ key ; } }
Retrieves the value of an array element or object property with the given key or property name.
If the key does not exist in the array, the default value will be returned instead.

@param array|object $array array or object to extract value from
@param string|\Closure $key key name of the array element, or property name of the object,
or an anonymous function returning the value. The anonymous function signature should be:
`function($array, $defaultValue)`.
@param mixed $default the default value to be returned if the specified key does not exist
@return mixed the value of the
Retrieves the value of an array element or object property with the given key or property name . If the key does not exist in the array the default value will be returned instead .