php.net |  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: -
Votes:3
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
Have you experienced this issue?
Rate the importance of this bug to you:

 [2020-03-09 17:58 UTC] azjezz at protonmail dot com
Description:
------------
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) 

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

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.


https://wiki.php.net/rfc/preload
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 15:01:28 2024 UTC