php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #27496 'some_function() or throw' doesn't work
Submitted: 2004-03-04 11:42 UTC Modified: 2004-03-04 11:45 UTC
From: sergio at alsernet dot es Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 5.0.0b4 (beta4) OS: Linux 2.6.3
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: sergio at alsernet dot es
New email:
PHP Version: OS:

 

 [2004-03-04 11:42 UTC] sergio at alsernet dot es
Description:
------------
This code generates a 'parse error': 
 
try { 
  @some_function() or throw new 
Exception("Error"); //parse error in this line 
}catch (Exception $e) { 
  ... 
} 
 
But this code works ok: 
 
try { 
  @some_function() or die("I should throw a exception 
here"); 
}catch (Exception $e) { 
  ... 
} 
 
some_function(), of course returns a boolean value. I'm 
running this code from a CLI. 
 

Reproduce code:
---------------
try {
  @some_function() or throw new Exception("Error"); //parse error in this line
}catch (Exception $e) {
  ...
}


Expected result:
----------------
Something instead a 'Parse Error' 

Actual result:
--------------
 

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-03-04 11:45 UTC] derick@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Dec 04 03:00:01 2025 UTC