# [PATCH] entry #35269

- Thread: https://externals.io/message/21463
- Original archive: https://news-web.php.net/php.internals/21463
- Started by Thiago Silva on 2006-01-10T16:13:02+00:00
- Messages: 4
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #21463 — Thiago Silva — 2006-01-10T16:13:02+00:00

URL: https://externals.io/message/21463#21463

Hi,
can anyone review this?

It's a one-line patch for the silent operator (@), wich currently supress 
fatal error messages (undesirable for "@include" pehaps, wich makes difficult 
for debugging scripts).

-- 
+Thiago Silva

---

## #21464 — Antony Dovgal — 2006-01-10T19:37:53+00:00

URL: https://externals.io/message/21463#21464 · In reply to: #21463

> Hi,
> can anyone review this?
> 
> It's a one-line patch for the silent operator (@), wich currently supress 
> fatal error messages (undesirable for "@include" pehaps, wich makes difficult 
> for debugging scripts).

With this patch you basically change whole @ functionality, thus breaking both BC and expected behavior in the same time.
And even in the case with include() - this is _expected_. 
If you don't want to see all error messages silenced, just use set_error_reporting() to set desired error level. 


> Index: Zend/zend_vm_execute.h
> ===================================================================
> RCS file: /repository/ZendEngine2/zend_vm_execute.h,v
> retrieving revision 1.62.2.23
> diff -u -r1.62.2.23 zend_vm_execute.h
> --- Zend/zend_vm_execute.h	4 Jan 2006 23:53:04 -0000	1.62.2.23
> +++ Zend/zend_vm_execute.h	10 Jan 2006 18:01:53 -0000
> @@ -434,7 +434,8 @@
>  	}
>  	
>  	if (EG(error_reporting)) {
> -		zend_alter_ini_entry("error_reporting", sizeof("error_reporting"), "0", 1, ZEND_INI_USER, ZEND_INI_STAGE_RUNTIME);
> +		/* 341 == E_COMPILE_ERROR|E_ERROR|E_CORE_ERROR|E_PARSE|E_USER_ERROR */
> +		zend_alter_ini_entry("error_reporting", sizeof("error_reporting"), "341", 3, ZEND_INI_USER, ZEND_INI_STAGE_RUNTIME);
>  	}
>  	ZEND_VM_NEXT_OPCODE();
>  }

-- 
Wbr, 
Antony Dovgal

---

## #21474 — Tim Starling — 2006-01-11T11:32:13+00:00

URL: https://externals.io/message/21463#21474 · In reply to: #21464

Antony Dovgal wrote:
> 
> 
> > […]
> 
> 
> With this patch you basically change whole @ functionality, thus
> breaking both BC and expected behavior in the same time.
> And even in the case with include() - this is _expected_. If you don't
> want to see all error messages silenced, just use set_error_reporting()
> to set desired error level.

Suppression of fatals is an irritating misfeature. There's nothing worse
than trying to work out where in tens of thousands of lines of code some
idiot developer put an @ before a function invocation where the function is
only available on some systems. In MediaWiki we use wfSuppressWarnings() and
wfRestoreWarnings() instead of @, but of course that's slower to type and to
execute, so the temptation is always there to use the evil @.

If suppression of fatals could be switched off, even as an INI setting off
by default, it would be a great help to developers.

-- Tim Starling

---

## #21475 — Derick Rethans — 2006-01-11T11:39:26+00:00

URL: https://externals.io/message/21463#21475 · In reply to: #21474

> Suppression of fatals is an irritating misfeature. There's nothing worse
> than trying to work out where in tens of thousands of lines of code some
> idiot developer put an @ before a function invocation where the function is
> only available on some systems. In MediaWiki we use wfSuppressWarnings() and
> wfRestoreWarnings() instead of @, but of course that's slower to type and to
> execute, so the temptation is always there to use the evil @.
> 
> If suppression of fatals could be switched off, even as an INI setting off
> by default, it would be a great help to developers.

error_reporting( `E_ALL` ^ (E_RECOVERABLE_ERROR | `E_WARNING` | E_NOTICE) );

regards,
Derick

-- 
Derick Rethans
http://derickrethans.nl | http://ez.no | http://xdebug.org
