php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #71891 header_register_callback() and register_shutdown_function()
Submitted: 2016-03-24 16:30 UTC Modified: 2016-03-25 03:09 UTC
From: david at grudl dot com Assigned: laruence
Status: Closed Package: Scripting Engine problem
PHP Version: 7.0.4 OS:
Private report: No CVE-ID:
 [2016-03-24 16:30 UTC] david at grudl dot com
Description:
------------
register_shutdown_function() inside header_register_callback() is not working https://3v4l.org/YHam1

Test script:
---------------
<?php

header_register_callback(function () {
	echo 'header';
	register_shutdown_function(function () {
		echo 'shutdown';
	});
});

Expected result:
----------------
writes "header shutdown"

Actual result:
--------------
writes "header"

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-03-25 01:18 UTC] requinix@php.net
https://3v4l.org/L1s8d - works as expected with this setup. ("header 1" shouldn't appear because its callback was registered after shutdown already began.)
 [2016-03-25 03:09 UTC] laruence@php.net
-Assigned To: +Assigned To: laruence
 [2016-03-25 03:09 UTC] laruence@php.net
However, this triggers a memleak report..

we should fix it in somehow
 [2016-03-25 04:35 UTC] laruence@php.net
Automatic comment on behalf of laruence@gmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=1929fc9b16c836c1449dee3fd3570031ff8dcba1
Log: Fixed bug #71891 (header_register_callback() and register_shutdown_function())
 [2016-03-25 04:35 UTC] laruence@php.net
-Status: Assigned +Status: Closed
 [2016-07-20 11:32 UTC] davey@php.net
Automatic comment on behalf of laruence@gmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=1929fc9b16c836c1449dee3fd3570031ff8dcba1
Log: Fixed bug #71891 (header_register_callback() and register_shutdown_function())
 
PHP Copyright © 2001-2017 The PHP Group
All rights reserved.
Last updated: Wed Feb 22 15:01:37 2017 UTC