php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #40682 set_error_handler doesn't respect @ operator
Submitted: 2007-03-01 16:59 UTC Modified: 2007-03-01 17:03 UTC
From: quintenbernaert at gmail dot com Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 4.4.6 OS: Linux
Private report: No CVE-ID: None
 [2007-03-01 16:59 UTC] quintenbernaert at gmail dot com
Description:
------------
set_error_handler doesn't respect the @ operator and it should respect it. The @ does ignore errors of that function. set_error_handler report errors. But if I put an @ before a function, set_error_handler still show the error and it shouldn't show it.

Reproduce code:
---------------
<?php
function errors($errno, $errstr, $errfile, $errline)
{
	echo 'Error handler<br /><br />

	'.$errno.'<br />
	'.$errstr.'<br />
	'.$errfile.'<br />
	'.$errline.'<br />';
}

set_error_handler("errors");

@getimagesize();
?>

Expected result:
----------------
Empty page.

Actual result:
--------------
Error handler

2
Wrong parameter count for getimagesize()
/home/quinten/www/problem_errorhandler.php
14

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-03-01 17:03 UTC] tony2001@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 14:00:01 2025 UTC