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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: azjezz at protonmail dot com
New email:
PHP Version: OS:

 

 [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-2020 The PHP Group
All rights reserved.
Last updated: Fri Oct 30 05:02:34 2020 UTC