|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #31714 exception suppression using @ doesnt work when php is installed asApache module
Submitted: 2005-01-27 03:10 UTC Modified: 2005-01-27 08:12 UTC
Avg. Score:5.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: alexei at net24 dot co dot nz Assigned:
Status: Not a bug Package: *Web Server problem
PHP Version: 5.0.3 OS: freebsd
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 this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: alexei at net24 dot co dot nz
New email:
PHP Version: OS:


 [2005-01-27 03:10 UTC] alexei at net24 dot co dot nz
When error suppression operator is used for the function where exception can be thrown it DOES suppress exception when script is called using CLI but DOES NOT do it when script is called from apache

Reproduce code:
function throw_ex() {
    throw new exception();

echo 1;

@throw_ex(); // suppress exception

echo 2;

Expected result:

Actual result:
when called via CLI:

when called from apache:


there's also no fatal error displayed, script just silently dies


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2005-01-27 03:47 UTC] alexei at net24 dot co dot nz

seems that it does not work when called via CLI either
all it does is hiding fatal error message but does not
suppress exception
 [2005-01-27 03:49 UTC] alexei at net24 dot co dot nz
this can be desired behaviour
 [2005-01-27 08:12 UTC]
It is. The shutup operator (@) will hide the message in this case, but a fatal error is always fatal - resulting in no message to be shown. See also:
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Fri Mar 24 20:03:41 2023 UTC