Replacement for gallery_shortcode function not taking all attributes

<?php
function modified_post_gallery( $blank = NULL, $attr ) 
{
    echo '<pre>'; 
            print_r( $attr ); 
    echo '</pre>';
}
add_filter( 'post_gallery', 'modified_post_gallery', 10, 2);
?>

In media.php it shows the filter like this:

// Allow plugins/themes to override the default gallery template.
$output = apply_filters('post_gallery', '', $attr);

Its passing two variables not one and $attr is on the second variable.

tech