Hi Nikita,

> So the problem basically is that in PHP 7.0 both print_r and var_dump directly
> print to output. This means that by the time the exception is thrown, we've
> already written output. This makes it unclear how exactly the exception should
> be handled. Is it okay to just print everything and handle the exception
> afterward? This seems odd to me -- if an operation fails it shouldn't do 
> anything.
> In PHP 7.1 I've rewritten print_r() to use an internal buffer, so we could 
> handle
> this case completely gracefully. The same change could be implemented for
> var_dump(). With this approach we'd only print anything if no exception
> occurred.
How it sounds, there were two different ways to solve this in 7.0 and 7.1? As 
7.0 has limitations, IMHO it's fine to go by Hui's suggestion fatal+exception 
text. It could be also ok to leave the state as it was before 2d8ab515 in 7.0, 
so either way. But for 7.1, as it's possible to get rid of the fatal in favor 
of catchable exception, probably it'd be the right way to go. Is that what you 

I had no chance to look into your print_r changes yet. Could it be possibly 
backported into 7.0, so both could go by same solution?



PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to