static function grabFunctionParameters($class, $function, array $paramValues)
    {
        $declaredParams = (new \ReflectionMethod($class, $function))->getParameters();
        $paramNames = array_map(function(\ReflectionParameter $v) {
            return $v->getName();
        },
            $declaredParams
        );
        $paramDefaults = array_map(function(\ReflectionParameter $v) {
            return $v->isOptional() ? $v->getDefaultValue() : null;
        },
            $declaredParams
        );

        return array_combine($paramNames, array_replace($paramDefaults, $paramValues));
    }
static function grabFunctionParameters($class, $function, array $paramValues)
    {
        $declaredParams = (new \ReflectionMethod($class, $function))->getParameters();
        $paramNames = array_map(function(\ReflectionParameter $v) {
            return $v->getName();
        },
            $declaredParams
        );
        $paramDefaults = array_map(function(\ReflectionParameter $v) {
            return $v->isOptional() ? $v->getDefaultValue() : null;
        },
            $declaredParams
        );

        return array_combine($paramNames, array_replace($paramDefaults, $paramValues));
    }
static function grabFunctionParameters ( $ class , $ function , array $ paramValues ) { $ declaredParams = ( new \ ReflectionMethod ( $ class , $ function ) ) -> getParameters ( ) ; $ paramNames = array_map ( function ( \ ReflectionParameter $ v ) { return $ v -> getName ( ) ; } , $ declaredParams ) ; $ paramDefaults = array_map ( function ( \ ReflectionParameter $ v ) { return $ v -> isOptional ( ) ? $ v -> getDefaultValue ( ) : null ; } , $ declaredParams ) ; return array_combine ( $ paramNames , array_replace ( $ paramDefaults , $ paramValues ) ) ; }
Return array keyed by parameter name of values passed into a class static function

@param string $class Name of class that has the method usually via __CLASS__
@param string $function Name of function to inspect usually via __FUNCTION__
@param array $paramValues array of actual values usually via func_get_args

@return array
Return array keyed by parameter name of values passed into a class static function