php-src/tests/basic/header_register_callback_after_output.phpt
Nikita Popov 9bff96396d Don't leak header callback if headers already sent
We need to avoid storing it in the first place, as we don't
really have a good place to release it later. If headers haven't
been sent yet, send_headers will do this. sapi_deactive happens
too late in the shutdown sequence and will result in leak reports.
2021-09-16 15:31:27 +02:00

10 lines
185 B
PHP

--TEST--
Call header_register_callback() after headers sent
--FILE--
<?php
echo "Send headers.\n";
header_register_callback(function() { echo "Too late";});
?>
--EXPECT--
Send headers.