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
 [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

Pull Requests

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: Sat Dec 21 11:01:30 2024 UTC