[PATCH] entry #35269

php.internals

Thiago Silva

20 years ago
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

Antony Dovgal

20 years ago
On 10.01.2006 19:13, Thiago Silva wrote:
> 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

Tim Starling

20 years ago
Antony Dovgal wrote:
> On 10.01.2006 19:13, Thiago Silva wrote: > >> 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.
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

Derick Rethans

20 years ago
On Wed, 11 Jan 2006, Tim Starling wrote:
> 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