|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #76509 Inherited static properties can be desynchronized from their parent by ref
Submitted: 2018-06-21 10:51 UTC Modified: 2018-06-21 11:14 UTC
From: Assigned: bwoebi (profile)
Status: Closed Package: Scripting Engine problem
PHP Version: 7.0Git-2018-06-21 (Git) OS: Irrelevant
Private report: No CVE-ID: None
 [2018-06-21 10:51 UTC]
Inherited static properties shall be invariantly read from the same base source throughout the script life.

However assigning a reference to an inherited static property it stops being connected to their parent and this the child and the property stop sharing their common value.

Test script:
class Test {
    public static $x = 0;

class Test2 extends Test { }

Test2::$x = &$x;
$x = 1;
var_dump(Test::$x, Test2::$x);

Expected result:

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2018-06-21 11:14 UTC]
-Assigned To: +Assigned To: bwoebi
 [2018-06-25 13:04 UTC]
Automatic comment on behalf of
Log: Fixed bug #76509
 [2018-06-25 13:04 UTC]
-Status: Assigned +Status: Closed
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Fri Sep 29 08:01:24 2023 UTC