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
 [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

Add a Patch

Pull Requests

Add a Pull Request

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-2024 The PHP Group
All rights reserved.
Last updated: Mon May 06 06:01:31 2024 UTC