diff --git a/ext/opcache/ZendAccelerator.c b/ext/opcache/ZendAccelerator.c index f9e67efee86..3214477e63b 100644 --- a/ext/opcache/ZendAccelerator.c +++ b/ext/opcache/ZendAccelerator.c @@ -3335,7 +3335,14 @@ static void preload_link(void) zv = zend_hash_set_bucket_key(EG(class_table), (Bucket*)zv, key); zend_string_release(key); if (EXPECTED(zv)) { + /* Set filename & lineno information for inheritance errors */ + CG(in_compilation) = 1; + CG(compiled_filename) = ce->info.user.filename; + CG(zend_lineno) = ce->info.user.line_start; zend_do_link_class(ce, parent); + CG(in_compilation) = 0; + CG(compiled_filename) = NULL; + changed = 1; } } diff --git a/ext/opcache/tests/preload_006.phpt b/ext/opcache/tests/preload_006.phpt index 925b9a60b8d..bbecfcf9473 100644 --- a/ext/opcache/tests/preload_006.phpt +++ b/ext/opcache/tests/preload_006.phpt @@ -11,5 +11,5 @@ opcache.preload={PWD}/preload_inheritance_error_ind.inc ---EXPECT-- -Fatal error: Declaration of B::foo($bar) must be compatible with A::foo() in Unknown on line 0 +--EXPECTF-- +Fatal error: Declaration of B::foo($bar) must be compatible with A::foo() in %spreload_inheritance_error.inc on line 7