src/helpers/ArrayHelper.php
public static function get( $var, $key, $default = null ) {

		if( $key === null )
			return $var;
		elseif( isset($var->$key) )
			return $var->$key;
		elseif( isset($var[$key]) )
			return $var[$key];
		else
			return $default;

	}
public static function get( $var, $key, $default = null ) {

		if( $key === null )
			return $var;
		elseif( isset($var->$key) )
			return $var->$key;
		elseif( isset($var[$key]) )
			return $var[$key];
		else
			return $default;

	}
public static function get ( $ var , $ key , $ default = null ) { if ( $ key === null ) return $ var ; elseif ( isset ( $ var -> $ key ) ) return $ var -> $ key ; elseif ( isset ( $ var [ $ key ] ) ) return $ var [ $ key ] ; else return $ default ; }
Return value of the specified key from an array or object or a default if the key isn't set.
@param  array|object   $var
@param  string|integer $key
@param  mixed          $default
@return mixed
Return value of the specified key from an array or object or a default if the key isn t set .