Non-static method PEAR::isError() should not be called statically
I'm afraid @johannes is incorrect - this is very doable. Simply substitute this in your recipe:
if ((new PEAR)->isError($mdb2_dbx)) {
// Victory! Er, I mean, Error!
...
}
It may be worth noting that that calling PEAR::isError($obj)
with one argument is equivalent to is_a($obj, 'PEAR_Error')
, if you're updating your own code. I know it is not best practice to "unwrap" a library method like that, but it is basically just an "instance of" check.
No there isn't. PEAR::isError
is legacy from PHP 4 times.
If changing the error level in php.ini
is not enough you should check
- whether there is another php.ini file being loaded (check phpinfo() output via Apache)
- some script sets the error level.
If all that doesn't help, set an appropriate level using the error_level()
function at runtime, or if nothing else helps, suppress the errors using the @
operator. Using @
should be avoided as it is relatively "slow" (error reporting is slow anyways ...) and it might hide other errors.
Long-term suggestion would be to use more modern libraries.