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
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
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