|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #79360 Unable to preload constants
Submitted: 2020-03-09 17:58 UTC Modified: -
Avg. Score:4.7 ± 0.5
Reproduced:3 of 3 (100.0%)
Same Version:3 (100.0%)
Same OS:3 (100.0%)
From: azjezz at protonmail dot com Assigned:
Status: Open Package: opcache
PHP Version: 7.4.3 OS:
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:
From: azjezz at protonmail dot com
New email:
PHP Version: OS:


 [2020-03-09 17:58 UTC] azjezz at protonmail dot com
Preloading doesn't support constants defined with either `const` or `define`

Test script:
// preload.php

define('FOO', 'foo');

const BAR = 'bar';

class Baz {}

// index.php

var_dump(defined('FOO'), defined('BAR'), class_exists(Baz::class));

Expected result:
bool(true) bool(true) bool(true) 

Actual result:
bool(false) bool(false) bool(true) 


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2020-03-19 01:33 UTC] thedinosaurmail at gmail dot com
Preloading is implemented as a part of the opcache on top of another (already committed) patch that introduces “immutable” classes and functions.
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Mon Jul 04 02:05:45 2022 UTC