Bug #79487 [PATCH]: ::getStaticProperties() ignores property modifications
| From: | cmb@php.net | Date: | Tue, 21 Apr 2020 13:16:15 +0000 |
| Subject: | Bug #79487 [PATCH]: ::getStaticProperties() ignores property modifications | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-226703@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=79487&edit=1
ID: 79487
Patch added by: cmb@php.net
Reported by: cmb@php.net
Summary: ::getStaticProperties() ignores property
modifications
Status: Assigned
Type: Bug
Package: opcache
Operating System: Windows
PHP Version: 7.4Git-2020-04-17 (Git)
Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
The following pull request has been associated:
Patch Name: Fix #79487: ::getStaticProperties() ignores property modifications
On GitHub: https://github.com/php/php-src/pull/5429
Patch: https://github.com/php/php-src/pull/5429.patch
Previous Comments:
------------------------------------------------------------------------
[2020-04-18 15:28:58] cmb@php.net
This regression has apparently been introduced with commit
d57cd36[1], and is not particularly related to Windows.
[1] <http://git.php.net/?p=php-src.git;a=commit;h=d57cd36e47b627dee5b825760163f8e62e23ab28>
------------------------------------------------------------------------
[2020-04-17 16:36:19] cmb@php.net
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 this bug report at https://bugs.php.net/bug.php?id=79487&edit=1