php-src/Zend/tests/bug65322.phpt
Nikita Popov f0c926564c Fix bug #65322: compile time errors won't trigger auto loading
Also fixes duplicate bugs #54054 and #42098.

Furthermore this fixes incorrect error messages thrown from code
running inside an error handler when a compilation is in progress.
The error file and line are now correctly associated with the
file/line of the executor, rather than the compiler.
2013-09-29 17:58:25 +02:00

23 lines
449 B
PHP

--TEST--
Bug #65322: compile time errors won't trigger auto loading
--FILE--
<?php
spl_autoload_register(function($class) {
var_dump($class);
class B {}
});
set_error_handler(function($_, $msg, $file) {
var_dump($msg, $file);
new B;
});
eval('class A { function a() {} function __construct() {} }');
?>
--EXPECTF--
string(50) "Redefining already defined constructor for class A"
string(%d) "%s(%d) : eval()'d code"
string(1) "B"