the E_STRICT
is an error type that issued at compile-time. and user
error handler is called, switching to runtime. mixing
runtime/compile-time is imho, not good, and cause problem in the real
world.
the flow:
script, include -> compiling, issue E_STRICT
-> user error handler.
official bug:
- set up user error handler
- issue
E_STRICT
inside class compiling
function my_error_handler()
{
include_once "debugger.class.php"; // #1
$dbg = Debugger::getInstance();
...
}
is the behavior defined at point #1 ? if it is allowed, what if wrote
"class Debugger { ..." into debugger.class.php ? it just tell me "u
cannot declare class inside another class" (something like this)
3rd party bug:
XCache is doing nice on late class binding by building "compiler
sandbox" for ZendEngine, which clear class_table/function_table
temporarily, to make the compiler-env exactly the same every time.
but inside the sandbox, functions/classes defined before compiling, is
never exists inside the compile-time, leading to a "undefined
function" or "undefined class" error inside user error handler.
yes, the author should hack, but it's better done in php-src or ZendEngine side.
solution propose:
- never call user error handler for
E_STRICT
- add
E_STRICT
to pending list and issue it after compiling. (after
returning from compile_file)