Skip to content
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

Report active output buffering handlers #74

Closed
bobbingwide opened this issue Oct 9, 2018 · 2 comments
Closed

Report active output buffering handlers #74

bobbingwide opened this issue Oct 9, 2018 · 2 comments

Comments

@bobbingwide
Copy link
Owner

@bobbingwide bobbingwide commented Oct 9, 2018

When output buffering is active we can't use print_r() so we call bw_trace_obsafe_print_r(). See #1.

Tracing of large data structures is significantly slower using the replacement function.
It would be nice to know what output buffering handlers are active.
This may help us determine how to speed up tracing.

@bobbingwide

This comment has been minimized.

Copy link
Owner Author

@bobbingwide bobbingwide commented Nov 22, 2019

In the current version of the documentation for print_r() https://www.php.net/manual/en/function.print-r.php it says

Note:
When the return parameter is used, this function uses internal output buffering so it cannot be used inside an ob_start() callback function.

In the documentation for ob_start() https://www.php.net/manual/en/function.ob-start.php we see this

ob_end_clean(), ob_end_flush(), ob_clean(), ob_flush() and ob_start() may not be called from a callback function. If you call them from callback function, the behavior is undefined. If you would like to delete the contents of a buffer, return "" (a null string) from callback function.

You can't even call functions using the output buffering functions like print_r($expression, true) or highlight_file($filename, true) from a callback function.

The reason I'm writing this is that I'm not sure if I still need to worry about having to call bw_trace_obsafe_print_r().

And if I don't have to do that then why do we need to know about output buffer handlers?

I think one of the problems is that I may not be producing the error situation yet.

@bobbingwide bobbingwide closed this Dec 5, 2019
v3.0.0 - Improved control over tracing and GDPR considerations automation moved this from In progress to Done Dec 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
1 participant
You can’t perform that action at this time.