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 (profile)
Status: Closed Package: Scripting Engine problem
PHP Version: 7.0.4 OS:
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: david at grudl dot com
New email:
PHP Version: OS:

 

 [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

Pull Requests

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-2024 The PHP Group
All rights reserved.
Last updated: Fri Oct 04 09:01:27 2024 UTC