Bug #79487 [NEW]: ::getStaticProperties() ignores property modifications

From: Date: Fri, 17 Apr 2020 16:36:19 +0000
Subject: Bug #79487 [NEW]: ::getStaticProperties() ignores property modifications
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-226646@lists.php.net to get a copy of this message
From:             cmb
Operating system: Windows
PHP version:      7.4Git-2020-04-17 (Git)
Package:          opcache
Bug Type:         Bug
Bug description:::getStaticProperties() ignores property modifications

Description:
------------
If OPcache is enabled, any changes to static properties are not
recognized by ReflectionClass::getStaticProperties(); instead the
original values are returned.  This happens as of PHP 7.4.


Test script:
---------------
<?php
class Foo {
    public static $bar = 'orig';
}

Foo::$bar = 'new';
$rc = new ReflectionClass('Foo');
var_dump($rc->getStaticProperties());
?>


Expected result:
----------------
array(1) {
  ["bar"]=>
  string(3) "new"
}


Actual result:
--------------
array(1) {
  ["bar"]=>
  string(4) "orig"
}


-- 
Edit bug report at https://bugs.php.net/bug.php?id=79487&edit=1
-- 
Fix committed:                    https://bugs.php.net/fix.php?id=79487&r=fixed
Fixed in release:                 https://bugs.php.net/fix.php?id=79487&r=alreadyfixed
Need backtrace:                   https://bugs.php.net/fix.php?id=79487&r=needtrace
Need Reproduce Script:            https://bugs.php.net/fix.php?id=79487&r=needscript
Try newer version:                https://bugs.php.net/fix.php?id=79487&r=oldversion
Not developer issue:              https://bugs.php.net/fix.php?id=79487&r=support
Expected behavior:                https://bugs.php.net/fix.php?id=79487&r=notwrong
Not enough info:                  https://bugs.php.net/fix.php?id=79487&r=notenoughinfo
Submitted twice:                  https://bugs.php.net/fix.php?id=79487&r=submittedtwice
register_globals:                 https://bugs.php.net/fix.php?id=79487&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=79487&r=phptooold
Daylight Savings:                 https://bugs.php.net/fix.php?id=79487&r=dst
IIS Stability:                    https://bugs.php.net/fix.php?id=79487&r=isapi
Install GNU Sed:                  https://bugs.php.net/fix.php?id=79487&r=gnused
Floating point limitations:       https://bugs.php.net/fix.php?id=79487&r=float
No Zend Extensions:               https://bugs.php.net/fix.php?id=79487&r=nozend
MySQL Configuration Error:        https://bugs.php.net/fix.php?id=79487&r=mysqlcfg


Thread (4 messages)

« previous php.bugs (#226646) next »