php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #41744 about try...catch...
Submitted: 2007-06-20 00:42 UTC Modified: 2007-06-21 23:04 UTC
From: edwardhey at 163 dot com Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 5.2.1 OS: freebsd
Private report: No CVE-ID:
 [2007-06-20 00:42 UTC] edwardhey at 163 dot com
Description:
------------
hi~!

when i use 'try' to catch the 'exception',the server throw me the 
Fatal error.

php: php5.2.1/fastcgi
server: apache2.2.3


Reproduce code:
---------------
<?php
try {
    $error = 'Always throw this error';
    throw new Exception($error);
    echo 'Never executed';

} catch (Exception $e) {
    echo 'Caught exception: ',  $e->getMessage(), "\n";
}
echo 'Hello World';
?> 

Expected result:
----------------
Fatal error: Uncaught exception 'Exception' with message 'Always throw this error' in /www/phpoo.cn/htdocs/test.php:4 Stack trace: #0 {main} thrown in /www/phpoo.cn/htdocs/test.php on line 4


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-06-20 07:01 UTC] derick@php.net
Do you have any extensions loaded, particularly "Zend" extensions?
 [2007-06-20 07:20 UTC] edwardhey at 163 dot com
yes,i have
about this:
   Zend Extension  220060519  

My phpinfo information:
   http://www.phpoo.cn/tan/iProber.php?act=phpinfo

thanks a lot!
 [2007-06-20 10:02 UTC] sniper@php.net
First you need to disable all 3rd party extensions, like any Zend extensions.
 [2007-06-20 10:03 UTC] sniper@php.net
And why do you report bugs in old releases? The latest is 5.2.3..you have 5.2.1!
 [2007-06-20 23:42 UTC] edwardhey at 163 dot com
i will keep trying and upgrade my php, thanks a lot!
 [2007-06-21 21:49 UTC] johannes@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows (zip):
 
  http://snaps.php.net/win32/php5.2-win32-latest.zip

For Windows (installer):

  http://snaps.php.net/win32/php5.2-win32-installer-latest.msi

Please keep the status as Feedback until you'Ve updated PHP so we can keep track of the issue.
 [2007-06-21 22:56 UTC] judas dot iscariote at gmail dot com
This bug can be safetely labeled bogus.

This is a bug on Eaccelator optimizer.

http://eaccelerator.net/ticket/242


rebuild EA with --without-eaccelerator-optimizer and should work again.

Remember, do not fill bug reports with zend extensions loaded !!
 [2007-06-21 23:04 UTC] johannes@php.net
Do not file bugs when you have Zend extensions (zend_extension=)
loaded. Examples are Zend Optimizer, Zend Debugger, Turck MM Cache,
APC, Xdebug and ionCube loader.  These extensions often modify engine
behavior which is not related to PHP itself.

Thanks for the info about eAcc.
 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Fri Apr 18 23:01:58 2014 UTC