php throw exception is caught,but the error message still appear -



php throw exception is caught,but the error message still appear -

i utilize code of php manual create exception test,but weird message.

here code:

function inverse($x) { if (!$x) { throw new exception('division zero.'); } else homecoming 1/$x; } seek { echo inverse(5) . "\n"; echo inverse(0) . "\n"; } grab (exception $e) { echo 'caught exception: ', $e->getmessage(), "\n"; } // go on execution echo 'hello world';

and here output:

0.2 ( ! ) exception: partition zero. in /var/www/ooplearing/slash.php on line 10call stack#timememoryfunctionlocation10.0002330188{main}( )../slash.php:020.0002330232inverse( $x = 0 )../slash.php:17dump $_server$_server['http_host'] =string 'localhost' (length=9)$_server['server_name'] =string 'localhost' (length=9)dump $_getvariables in local scope (#2)$x =int 0 caught exception: partition zero.hello world

it's unusual although exception has been caught,but exception message still on...

some of local setting in php.ini :

error_reporting = e_all & ~e_deprecated display_errors =on display_startup_errors = off log_errors = off ...... html_errors = on

my notebook:

ubuntu11.04 mysql ver 14.14 distrib 5.1.54 php 5.3.5-1

update(2012.1.16) it's xdebug extension resulted in such error outputs.the xdebug default shows stack traces on error conditions.for want disable can below instruction:

xdebug_disable();//put on header of code,like cofig file.

more details

when try/catch() block of code wont fatal error of "uncaught exception". fatal error cause script stop executing @ point of error. since caught exception, did told to: echo string + error message, continued execution "hello world!". if error reporting more verbose due ini settings, stack trace printout.

php exception

Comments

Popular posts from this blog

How do I check if an insert was successful with MySQLdb in Python? -

delphi - blogger via idHTTP : error 400 bad request -

postgresql - ERROR: operator is not unique: unknown + unknown -