No previous output,but header redirect doesn't work in PHP
    header('Location: ' . $url);

I've checked that there is no previous output:

    ob_start();
    
    ...
    var_dump(ob_get_contents());
    ob_flush();
    header('Location: ' . $url);

outputs:

    string '' (length=0)

Then why does the redirect fail?

Though I see lots of warnings and notices in the `error_log`,but that doesn't affect `header()` as long as it doesn't output anything to the browser,right?
No previous output,but header redirect doesn't work in PHP
===

    header('Location: ' . $url);

I've checked that there is no previous output:

    ob_start();
    
    ...
    var_dump(ob_get_contents());
    ob_flush();
    header('Location: ' . $url);

outputs:

    string '' (length=0)

Then why does the redirect fail?

Though I see lots of warnings and notices in the `error_log`,but that doesn't affect `header()` as long as it doesn't output anything to the browser,right?