Greetings everyone!
I'm porting my applications to PHP5 and I've stumbled on yet another
problem. I'll try to simplify things a bit. I have a main script that
is being executed (index.php, PHP5 script) and that is including 2
other files: config.inc (PHP5 script, for the configuration) and
adodb.inc.php (PHP4 script, ADOdb functionality, though it could be
any other PHP4 script). On php.ini, error_reporting = E_ALL|E_STRICT.
These are the contents of the files:
- index.php:
<?php
include('config.inc');
include('adodb.inc.php');
?>
- config.inc:
<?php
error_reporting(E_ALL|E_STRICT);
?>
- adodb.inc.php:
<?php
error_reporting(E_ALL & ~E_STRICT);
// Following is the rest of the script with PHP4 things like:
class whatever {
var x;
......
}
?>
Now, what I was expecting was to have E_ALL and E_STRICT turned on
(because config.inc is included) and then, when parsing adodb.inc.php,
only E_ALL would be active. After adodb.inc.php is parsed, normal
behaviour set before by config.inc (i.e. E_ALL|E_STRICT) would be
resumed again.
But alas, this is not happening. The error_reporting() that I added to
the beginning of adodb.inc.php is not doing anything, since I keep
getting Strict Standards warnings in the adodb.inc.php file, saying
among other things that var is deprecated...
I'd like to have my new PHP5 application to have all the E_STRICT
warnings turned on, only turning them off for specific third party
scripts that are not completely compatible with that directive...
Is this a little bug with the error_reporting() in PHP5? Or what is
the problem?