Not displaying the wp_query object for the following code in the frontend

For just print the query object put this in your function.php:

add_action('wp_footer', function () {
    global $wp_query;

    echo '<pre>';
    print_r($wp_query);
    echo '</pre>';
    die;
});

tech