public static function &convertArray(array &$array = null, $converter, $arg = null)
    {
        if (is_null($array))
        {
            // 'return null' would generate the following warning.
            //
            //   "Only variable references should be returned by reference"
            //
            // Therefore, an intermidiate object is used here.
            $output = null;
            return $output;
        }

        $output = array();

        array_walk(
            $array,
            function ($value, $key) use ($converter, $arg, &$output)
            {
                if (is_null($arg))
                {
                    $output[] = $converter($value);
                }
                else
                {
                    $output[] = $converter($value, $arg);
                }
            }
        );

        return $output;
    }