[php-src] Issue #13965: Issue with ob handler context and execution in PHP
| From: | aswingit | Date: | Mon, 15 Apr 2024 11:11:03 +0000 |
| Subject: | [php-src] Issue #13965: Issue with ob handler context and execution in PHP | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-246759@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/13965
Author: aswingit
### Description
I am encountering an issue while working with the "_ob_start_" function in PHP and the
callback parameter.
**Description:**
When utilizing _ob_start("system")_ to initiate output buffering with the
"_system_" callback in the provided code snippet, I've observed that the
_zend_get_executed_filename_ function fails to return the correct file name when the
"system" zend function is executed.
This discrepancy occurs particularly when a flush operation happens during php_request_shutdown.
```
<?php
ob_start("system");
?>
```
**Observations:**
Upon debugging, I've noticed the following:
- Omission of the ob_flush() function call results in the flushing of output handlers during
php_request_shutdown.
- Prior to the invocation of _php_output_end_all_, the EG(current_execute_data) variable is set to
NULL.
- Consequently, when the "system" function is executed, it operates without the context of
the current executed file name, leading to unexpected behavior.
Expected Behavior:
I expect the _zend_get_executed_filename_ function to accurately retrieve the file name, even in
scenarios involving flush operations during _php_request_shutdown_
### PHP Version
PHP 8.3.3
### Operating System
_No response_