-
Notifications
You must be signed in to change notification settings - Fork 7.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue with ob handler context and execution in PHP #13965
Comments
@haszi do you maybe have an idea about this? |
No idea as this doesn't seem to be output buffering related. If I understand the above correctly what is being asked here is whether Lines 1829 to 1832 in bb6e611
|
Thank you. When the shutdown phase occurs and the output handler (in this case, 'system') is executed, it triggers zend_call_function. The issue arises because the current execution context is set to NULL, resulting in the absence of the previous execution context when the system or output handler callback command is executed. zend_get_executed_filename navigates through the context stack to locate the type of user-defined function in order to retrieve the filename. Without previous context, it's not able to derive filename. |
The description of your issue and your question under
I cannot comment on your question other than that the comment in the source code suggests that that is currently not possible. |
The problem isn't with the 'system' function, but with 'ob_flush'. Let's say I use a custom function from my extension that tries to read zend_get_executed_filename(). It doesn't get the right context when flush occurs during the shutdown phase. |
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.
Observations:
Upon debugging, I've noticed the following:
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. Is this feasible?
PHP Version
PHP 8.3.3
Operating System
No response
The text was updated successfully, but these errors were encountered: