Bug #76509 [NEW]: Inherited static properties can be desynchronized from their parent by ref
| From: | bwoebi@php.net | Date: | Thu, 21 Jun 2018 10:51:53 +0000 |
| Subject: | Bug #76509 [NEW]: Inherited static properties can be desynchronized from their parent by ref | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-215826@lists.php.net to get a copy of this message | ||
From: bwoebi
Operating system: Irrelevant
PHP version: 7.0Git-2018-06-21 (Git)
Package: Scripting Engine problem
Bug Type: Bug
Bug description:Inherited static properties can be desynchronized from their parent by ref
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 bug report at https://bugs.php.net/bug.php?id=76509&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=76509&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=76509&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=76509&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=76509&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=76509&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=76509&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=76509&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=76509&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=76509&r=support
Expected behavior: https://bugs.php.net/fix.php?id=76509&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=76509&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=76509&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=76509&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=76509&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=76509&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=76509&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=76509&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=76509&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=76509&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=76509&r=mysqlcfg