|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #79114 Eval class during preload causes class to be only half available
Submitted: 2020-01-14 11:50 UTC Modified: 2020-01-17 11:36 UTC
From: Assigned:
Status: Closed Package: opcache
PHP Version: 7.4.1 OS: Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
New email:
PHP Version: OS:


 [2020-01-14 11:50 UTC]
IF you eval a class during preload, you cannot instantiate it, but you can extend from it and class_parents shows its as parent. 

Test script:
// index.php
ini_set('display_errors', true);
var_dump(new Bar());
var_dump(new Foo());

// preload.php
eval("class Foo {}");
class Bar extends Foo {

Expected result:
bool(false) bool(true) object(Bar)#1 (0) { } array(1) { ["Foo"]=> string(3) "Foo" }
object(Foo)#2 (0) { }

Actual result:
bool(false) bool(true) object(Bar)#1 (0) { } array(1) { ["Foo"]=> string(3) "Foo" }
Fatal error: Uncaught Error: Class 'Foo' not found in /var/www/preload/index.php:10 Stack trace: #0 /home/benny/.symfony/php/a37c6f52bd8b76a9d0374711bf78143b455254a2-router.php(29): require() #1 {main} thrown in /var/www/preload/index.php on line 10


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2020-01-17 11:36 UTC]
-Status: Open +Status: Verified
 [2020-01-20 04:29 UTC]
Automatic comment on behalf of
Log: Fixed bug #79114 (Eval class during preload causes class to be only half available)
 [2020-01-20 04:29 UTC]
-Status: Verified +Status: Closed
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Jun 18 22:01:29 2024 UTC