Bug #76509 [Asn->Csd]: Inherited static properties can be desynchronized from their parent by ref

From: Date: Mon, 25 Jun 2018 13:04:20 +0000
Subject: Bug #76509 [Asn->Csd]: Inherited static properties can be desynchronized from their parent by ref
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-215968@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=76509&edit=1 ID: 76509 Updated by: nikic@php.net Reported by: bwoebi@php.net Summary: Inherited static properties can be desynchronized from their parent by ref -Status: Assigned +Status: Closed Type: Bug Package: Scripting Engine problem Operating System: Irrelevant PHP Version: 7.0Git-2018-06-21 (Git) Assigned To: bwoebi Block user comment: N Private report: N New Comment: Automatic comment on behalf of nikita.ppv@gmail.com Revision: http://git.php.net/?p=php-src.git;a=commit;h=2543e61aed67add7522e0b4cdf9a13cf3e441f6f Log: Fixed bug #76509 Previous Comments: ------------------------------------------------------------------------ [2018-06-21 10:51:52] bwoebi@php.net Description: ------------ 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: ---------------- int(1) int(1) Actual result: -------------- int(0) int(1) ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=76509&edit=1

« previous php.bugs (#215968) next »