php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #5601 @function() should not turn of error reporting for critical errors
Submitted: 2000-07-15 08:00 UTC Modified: 2010-08-07 01:38 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:1 (100.0%)
From: hartmut at six dot de Assigned:
Status: Wont fix Package: *General Issues
PHP Version: 4.0.1pl2 OS: *
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: hartmut at six dot de
New email:
PHP Version: OS:

 

 [2000-07-15 08:00 UTC] hartmut at six dot de
try for example 

<?php @nonexistant_function(); echo "done\n"; ?>

and you won't get any ouptut at all
because execution is terminated due to 
calling a nonexistant function

i just spent a lot of time debugging a set of 
script that denied to work on a server without
giving any information about whats wrong only 
to find out that somewhere nested deep within
all the files that got included was a 

  @OCILogin(...)

and this cauesd the script to die silently as 
no Oracle support was available in the PHP
build i used ... :(

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-07-15 07:26 UTC] stas at cvs dot php dot net
Well, why won't you use error_reporting setting then? Also, you might use report_error and log_errors (not sure those are exact names) to log errors only to logfilke and not to screen. @ is means to make it "real silent" not just "don't report unnecessary errors". 
 [2000-07-15 09:29 UTC] sterling at cvs dot php dot net
The purpose of the '@' is to turn off errors surrounding the function and leave you to do the checking.
 [2000-07-15 10:11 UTC] hholzgra at cvs dot php dot net
yes, but on *critical* errors (and i was refering 
only to those) php terminates so that i have no
chance to check anything

this is what this report is about 
 [2000-07-26 22:02 UTC] zak@php.net
This is certainly not a misbehaving function problem!
 [2000-07-28 18:19 UTC] hholzgra@php.net
so i would suggest the following patch:

zend_execute.c line 2330ff
  case ZEND_BEGIN_SILENCE:
    Ts[opline->result.u.var].tmp_var.value.lval = EG(error_reporting);
    Ts[opline->result.u.var].tmp_var.type = IS_LONG;  
-   EG(error_reporting) = 0;
+   EG(error_reporting) = E_ERROR | E_USER_ERROR; 
    NEXT_OPCODE();

 [2000-07-28 18:26 UTC] hholzgra@php.net
or maybe we could add another error type
called E_UNIGNORABLE_ERROR ...
 [2010-08-07 01:38 UTC] johannes@php.net
-Status: Analyzed +Status: Wont fix -Package: Feature/Change Request +Package: *General Issues
 [2010-08-07 01:38 UTC] johannes@php.net
The purpose of @ is to silence all down
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 22 01:01:30 2024 UTC