id,summary,reporter,owner,description,type,status,priority,milestone,component,version,resolution,keywords,cc,blockedby,phpversion,appname,pending,exts,sapi,probability,blocking
223,E_DEPRECATED error at parsing - Custom error handler cant access previously declared classes,patphobos,moo,"{{{
<?php

error_reporting(E_ALL);
set_error_handler('error');

function error($errno, $errstr, $errfile, $errline, $errcontext)
{
    echo ""PHP ERROR - error n°"" . $errno . ' : ' . $errstr . ""\n"";
    if (!class_exists('test42'))
        echo "" - hit a bug, test42"";
    die();
}
class test42 { }

require_once 'page_with_an_error.php';

?>
}}}

page_with_an_error.php:
{{{
<?php
function test(&$val) { }
$val = 'this is a test';

// Deprecated :
test(&$val);

?>
}}}

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 :
{{{
<?php

error_reporting(E_ALL);
set_error_handler('error');

function error($errno, $errstr, $errfile, $errline, $errcontext)
{
    if (!defined('DISPLAY_ERROR'))
        define('DISPLAY_ERROR', true);

    if (DISPLAY_ERROR)
        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
asort();

?>
}}}

'page_with_an_error.php' is the same file with the deprecated call by reference error.",defect,closed,major,3.0.0,cacher,,fixed,E_DEPRECATED,,,5.3,,0,,Irrelevant,Always,
