Opened 7 years ago

Closed 7 years ago

#127 closed defect (wontfix)

E_STRICT errors not caught by custom error handler

Reported by: c960657 Owned by: moo
Priority: minor Milestone:
Component: admin Version: 1.2.1
Keywords: Cc:
Application: PHP Version: 5.2.0
Other Exts: SAPI: Irrelevant
Probability: Always Blocked By:
Blocking:

Description

I use a custom error handler to mute E_STRICT errors generated by PEAR but display E_STRICT errors caused by my own code.

Without Xcache this works fine. When using Xcache not all errors are caught by the custom error handler.

<?php
function myErrorHandler($no, $msg, $file, $line) {
    if ($no == E_STRICT && strpos($file, '/pear/')) {
        // PEAR isn't E_STRICT compatible, so just ignore E_STRICT errors there
        return;
    }
    // Report error as usual
    // ...
}
set_error_handler('myErrorHandler');
require_once 'PEAR.php';
?>

When Xcache is enabled, PHP prints two error messages:

Strict Standards: Assigning the return value of new by reference is deprecated in /var/www/test.peytz.dk/pear/PEAR.php on line 569
Strict Standards: Assigning the return value of new by reference is deprecated in /var/www/test.peytz.dk/pear/PEAR.php on line 572

This only happens the first time the script is run after the cache has been emptied.

Change History (1)

comment:1 Changed 7 years ago by moo

  • Resolution set to wontfix
  • Status changed from new to closed

yep, it's by design. E_STRICT trigger user defined handler mixing runtime inside compiled, which is not compatible with XCache compiling

Note: See TracTickets for help on using tickets.