php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #17932 No way to determine @ operator usage from within custom errors handler
Submitted: 2002-06-23 05:41 UTC Modified: 2002-06-23 06:46 UTC
From: flying at dom dot natm dot ru Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 4.2.1 OS: Windows 2000
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: flying at dom dot natm dot ru
New email:
PHP Version: OS:

 

 [2002-06-23 05:41 UTC] flying at dom dot natm dot ru
 There is currently no way for custom error handler function to determine, if expression which generate any particular error was called using @ operator or not.
 For example there will be no difference between:

$fp = fopen('unavailable_file','r');
 and 
$fp = @fopen('unavailable_file','r');

 Warning will be thrown in both cases, while it must be only thrown into first case, as requested by programmer. So there must be some way to distinguish these cases. 
 Normally error_reporting() function should return 0, being called from custom error handler in a case, when @ operator was used, but it returns error reporting level, which is by default. I think it is wrong behaviour and it should be improved in a way, described before.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-06-23 05:45 UTC] derick@php.net
Can you please provide a full, self-contained script that shows this problem?

Derick
 [2002-06-23 06:23 UTC] flying at dom dot natm dot ru
Hmm... It looks like my previous tests have some other problems. error_reporting() function works fine together with @ operator. 

Sorry for bothering...
 [2002-06-23 06:46 UTC] derick@php.net
User error -> Bogus
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Thu Oct 08 11:00:02 2026 UTC