note 98414 added to function.error-reporting
| From: | keithm at aoeex dot com | Date: | Mon, 14 Jun 2010 17:23:30 +0000 |
| Subject: | note 98414 added to function.error-reporting | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-170119@lists.php.net to get a copy of this message | ||
Some E_STRICT errors seem to be thrown during the page's compilation process. This means they
cannot be disabled by dynamically altering the error level at run time within that page.
The work-around for this was to rename the file and replace the original with a error_reporting()
call and then a require() call.
Ex, rename index.php to index.inc.php, then re-create index.php as:
<?php
error_reporting(E_ALL & ~(E_STRICT|E_NOTICE));
require('index.inc.php');
?>
That allows you to alter the error reporting prior to the file being compiled.
I discovered this recently when I was given code from another development firm that triggered
several E_STRICT errors and I wanted to disable E_STRICT on a per-page basis.
----
Server IP: 74.208.45.212
Probable Submitter: 68.47.156.213 (proxied: 68.47.156.213)
----
Manual Page -- http://www.php.net/manual/en/function.error-reporting.php
Edit -- https://master.php.net/note/edit/98414
Del: integrated -- https://master.php.net/note/delete/98414/integrated
Del: useless -- https://master.php.net/note/delete/98414/useless
Del: bad code -- https://master.php.net/note/delete/98414/bad+code
Del: spam -- https://master.php.net/note/delete/98414/spam
Del: non-english -- https://master.php.net/note/delete/98414/non-english
Del: in docs -- https://master.php.net/note/delete/98414/in+docs
Del: other reasons-- https://master.php.net/note/delete/98414
Reject -- https://master.php.net/note/reject/98414
Search -- https://master.php.net/manage/user-notes.php