php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #78376 Incorrect preloading of constant static properties
Submitted: 2019-08-05 19:50 UTC Modified: 2019-08-05 19:50 UTC
From: dmitry@php.net Assigned: dmitry (profile)
Status: Closed Package: opcache
PHP Version: 7.4Git-2019-08-05 (Git) 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.
Password:
Status:
Package:
Bug Type:
Summary:
From: dmitry@php.net
New email:
PHP Version: OS:

 

 [2019-08-05 19:50 UTC] dmitry@php.net
Description:
------------
Default values of constant static properties may be preloaded incorrectly.

Test script:
---------------
preload.inc
-----------
<?php
const CNST = 'aaaa';
class A {
	public static $a = CNST;
}
$a = \A::$a;
?>

bug.php
-------
<?php
var_dump(\A::$a);
?>

Expected result:
----------------
string(4) "aaaa"

Actual result:
--------------
UNKNOWN:0

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2019-08-05 19:50 UTC] dmitry@php.net
-Assigned To: +Assigned To: dmitry
 [2019-08-05 19:56 UTC] dmitry@php.net
Automatic comment on behalf of dmitry@zend.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=3fc0e2bb80734c052dc1e0c34f93a3a7f4086557
Log: Fixed bug #78376 (Incorrect preloading of constant static properties)
 [2019-08-05 19:56 UTC] dmitry@php.net
-Status: Assigned +Status: Closed
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 06:01:29 2024 UTC