- Xdebug collects all headers being set, implicitly and explicitly
- It's very useful for testing and unit-tests
- xdebug_get_headers()
<?php
session_start();
setcookie( 'key', 'value', time() + 86400 );
header( "Status: 403" );
var_dump( xdebug_get_headers() );
?>
Output