php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #44027 try catch not working
Submitted: 2008-02-03 01:41 UTC Modified: 2008-02-03 02:22 UTC
From: anil dot softx at gmail dot com Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 5.2.5 OS: Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: anil dot softx at gmail dot com
New email:
PHP Version: OS:

 

 [2008-02-03 01:41 UTC] anil dot softx at gmail dot com
Description:
------------
Exception seems not working. Please see the example code below.


Reproduce code:
---------------
try{
    non_existant_function();
}catch(Exception $e){
  echo "Exception thrown:" . $e->getMessage();
}


Expected result:
----------------
Expected to throw exception in above code but the script dies with a Fatal error: call no non existant function ...


Actual result:
--------------
Fatal Error: call to non existant function non_existant_function().



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-02-03 02:22 UTC] rasmus@php.net
Exceptions are only thrown by OO code in PHP.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sat Dec 06 13:00:02 2025 UTC