Re: [PHP] Re: Throwing an exception seems to defeat output buffering

2009-02-03 Thread Alpár Török
2009/2/3 Shawn McKenzie > Wickland, Leif wrote: > > I would expect that if I turn on output buffering, echo something, throw > an exception, and catch the exception, nothing will have been actually > output.. That doesn't seem to be the case. Throwing an exception seems to > defeat output buffe

[PHP] Re: Throwing an exception seems to defeat output buffering

2009-02-03 Thread Shawn McKenzie
Wickland, Leif wrote: > I would expect that if I turn on output buffering, echo something, throw an > exception, and catch the exception, nothing will have been actually output.. > That doesn't seem to be the case. Throwing an exception seems to defeat > output buffering. > > In the following

[PHP] Re: Throwing an exception seems to defeat output buffering

2009-02-03 Thread Colin Guthrie
'Twas brillig, and Leif Wickland at 03/02/09 06:02 did gyre and gimble: I would expect that if I turn on output buffering, echo something, throw an exception, and catch the exception, nothing will have been actually output. That doesn't seem to be the case. Throwing an exception seems to defeat

[PHP] Re: Throwing an exception seems to defeat output buffering

2009-02-03 Thread Ondrej Kulaty
Output buffer is flushed at the end of script. When you throw that exception in try block, this command: exit( 'Contents: ' . ob_get_clean()); never executes and it continues to catch block where you are outputing exception message, and it is added to the buffer, then the script ends and buffer