Opened 10 years ago

Closed 7 years ago

#223 closed defect (fixed)

E_DEPRECATED error at parsing - Custom error handler cant access previously declared classes

Reported by: patphobos Owned by: moo
Priority: major Milestone: 3.0.0
Component: cacher Version:
Keywords: E_DEPRECATED Cc:
Application: PHP Version: 5.3
Other Exts: SAPI: Irrelevant
Probability: Always Blocked By:




function error($errno, $errstr, $errfile, $errline, $errcontext)
    echo "PHP ERROR - error n°" . $errno . ' : ' . $errstr . "\n";
    if (!class_exists('test42'))
        echo " - hit a bug, test42";
class test42 { }

require_once 'page_with_an_error.php';



function test(&$val) { }
$val = 'this is a test';

// Deprecated :


the custom error handler is catching the E_DEPRECATED error, but when cached, the error handler cant use any of previously existing objects (like test42 in this example).

Another testcase, that made my php5.3 to segfault :



function error($errno, $errstr, $errfile, $errline, $errcontext)
    if (!defined('DISPLAY_ERROR'))
        define('DISPLAY_ERROR', true);

        echo "PHP ERROR - error n°" . $errno . ' : ' . $errstr . "\n";

// 1st error E_DEPRECATED inside page_with_an_error.php
include 'page_with_an_error.php';

// 2nd error


'page_with_an_error.php' is the same file with the deprecated call by reference error.

Change History (6)

comment:1 Changed 10 years ago by patphobos

(i'm using xcache 1.3.0 stable, cant select this version on the trac form.)

comment:2 Changed 10 years ago by patphobos

(not all E_DEPRECATED error had this problem, only DEPRECATED_ERROR occuring at parsing, using deprecated function work fine)

comment:3 Changed 10 years ago by moo

  • Status changed from new to accepted

this was fixed in 2.0 already, but i'm not sure if it's fine to backport it to 1.3 yet. pending

comment:4 Changed 7 years ago by moo

  • Milestone changed from 1.3.3 to 2.0.1

Milestone 1.3.3 deleted

comment:5 Changed 7 years ago by moo

  • Status changed from accepted to new

comment:6 Changed 7 years ago by moo

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

already fixed in 2.0/3.0. 1.3 is old

Note: See TracTickets for help on using tickets.