#37925 [Fbk->Opn]: After a try catch block, the echo doens't work with an exit

From: Date: Tue, 27 Jun 2006 11:18:58 +0000
Subject: #37925 [Fbk->Opn]: After a try catch block, the echo doens't work with an exit
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-98823@lists.php.net to get a copy of this message
ID: 37925 User updated by: batataw at gmail dot com Reported By: batataw at gmail dot com -Status: Feedback +Status: Open Bug Type: Output Control Operating System: Linux Fedora PHP Version: 5.1.4 New Comment: <? try{ $sth->execute(); } catch(PDOException $e){ $errmsg = implode(":",$sth->errorInfo()); Error::userErrorHandler(E_USER_WARNING, 'DB Error : '. $errmsg, __FILE__, __LINE__, $errmsg); echo "Message Error"; exit; } ?> Previous Comments: ------------------------------------------------------------------------ [2006-06-27 11:14:45] tony2001@php.net Thank you for this bug report. To properly diagnose the problem, we need a short but complete example script to be able to reproduce this bug ourselves. A proper reproducing script starts with <?php and ends with ?>, is max. 10-20 lines long and does not require any external resources such as databases, etc. If possible, make the script source available online and provide an URL to it here. Try to avoid embedding huge scripts into the report. ------------------------------------------------------------------------ [2006-06-27 11:05:14] batataw at gmail dot com Description: ------------ After a Try/Catch block I used an exit. It's impossible to display all the echos (print, var_dump...) between the Try/Catch block and the exit. I had to use these functions to force the echo : $buffer = ob_get_flush();//hack flush(); exit; Reproduce code: --------------- //Execute Request try{ $sth->execute(); } catch(PDOException $e){ $errmsg = implode(":",$sth->errorInfo()); Error::userErrorHandler(E_USER_WARNING, 'DB Error : '. $errmsg, __FILE__, __LINE__, $errmsg); } ------------------------------------ echo "Message Error"; exit; Expected result: ---------------- Message Error Actual result: -------------- Nothing ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=37925&edit=1

« previous php.bugs (#98823) next »