mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
output: Fail starting to output buffer when the output layer is deactivated (#20846)
Fixes php/php-src#20837.
This commit is contained in:
@@ -21,4 +21,7 @@ ob_start(new Test, 1);
|
||||
echo "trigger bug";
|
||||
?>
|
||||
--EXPECTF--
|
||||
%r(Notice: ob_start\(\): Failed to create buffer in [^\r\n]+ on line \d+\r?\n(\r?\n)?)+%r
|
||||
Notice: ob_start(): Failed to create buffer in %s on line %d
|
||||
|
||||
Fatal error: ob_start(): Cannot use output buffering in output buffering display handlers in %s on line %d
|
||||
|
||||
23
tests/output/gh20837.phpt
Normal file
23
tests/output/gh20837.phpt
Normal file
@@ -0,0 +1,23 @@
|
||||
--TEST--
|
||||
ob_start(): NULL dereference when calling ob_start() in shutdown function triggered by bailout in php_output_lock_error()
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
register_shutdown_function(function () {
|
||||
ob_start(function ($input) {
|
||||
echo "bar";
|
||||
return strtoupper($input);
|
||||
});
|
||||
});
|
||||
|
||||
ob_start(function () {
|
||||
ob_start();
|
||||
}, 1);
|
||||
|
||||
echo "foo";
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: ob_start(): Cannot use output buffering in output buffering display handlers in %s on line %d
|
||||
|
||||
Notice: ob_start(): Failed to create buffer in %s on line %d
|
||||
Reference in New Issue
Block a user