Bug #81431 [PATCH]: header_register_calback no longer allows die() to stop executing outputting
| From: | twosee@php.net | Date: | Wed, 15 Sep 2021 10:03:53 +0000 |
| Subject: | Bug #81431 [PATCH]: header_register_calback no longer allows die() to stop executing outputting | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-236611@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=81431&edit=1
ID: 81431
Patch added by: twosee@php.net
Reported by: raoul_vanmaaren at live dot nl
Summary: header_register_calback no longer allows die() to
stop executing outputting
Status: Open
Type: Bug
Package: Output Control
PHP Version: 8.0.10
Block user comment: N
Private report: N
New Comment:
The following patch has been added/updated:
Patch Name: bug81431.patch
Revision: 1631700233
URL: https://bugs.php.net/patch-display.php?bug=81431&patch=bug81431.patch&revision=1631700233
Previous Comments:
------------------------------------------------------------------------
[2021-09-12 19:14:35] raoul_vanmaaren at live dot nl
With output buffering on, for some reason, the expected result is produced. This is similar
behaviour as previous versions. With output buffering off, it seems to behave in a different manner
than the previous versions and prodduces the unexpected result.
https://3v4l.org/pv9jE
------------------------------------------------------------------------
[2021-09-11 11:58:49] sjon@php.net
the output buffering calls don't seem to be relevant, see https://3v4l.org/Jsq2U
------------------------------------------------------------------------
[2021-09-11 10:17:39] raoul_vanmaaren at live dot nl
Description:
------------
In PHP 8.0.0 - 8.0.10, a die statement within the header_register_callback function will not prevent
the trigger from being outputted. In previous versions this was the case.
This is with the standard settings.
I am not sure if this is caused by the performance upgrades and if this is intended or not. However,
I cannot find any documentation either.
Test script:
---------------
<?php
ob_start(); // make sure ob_level is set to 1
function callback()
{
echo "In php 8.0.0 - 8.0.10, a die statement does prevent the trigger from being outputted:
";
die();
}
header_register_callback("callback");
ob_end_clean();
echo "Trigger.";
echo "Execution died before this echo statement.";
Expected result:
----------------
In php 8.0.0 - 8.0.10, a die statement does prevent the trigger from being outputted:
Actual result:
--------------
In php 8.0.0 - 8.0.10, a die statement does prevent the trigger from being outputted: Trigger.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=81431&edit=1