mirror of
https://github.com/php/php-src.git
synced 2026-03-25 16:52:18 +01:00
When running without opcache, static_members_table is shared with default_static_members_table. This is visible in reflection output, because ReflectionProperty::getDefaultValue() will return the current value, rather than the default value. Address this by never sharing the table, which matches the behavior we already see under opcache. Fixes bug #80821. Closes GH-7299.
19 lines
336 B
PHP
19 lines
336 B
PHP
--TEST--
|
|
Bug #80821: ReflectionProperty::getDefaultValue() returns current value for statics
|
|
--FILE--
|
|
<?php
|
|
|
|
class Statics {
|
|
public static $staticVar = 1;
|
|
}
|
|
|
|
Statics::$staticVar = 2;
|
|
|
|
$reflect = new \ReflectionClass(Statics::class);
|
|
$prop = $reflect->getProperty("staticVar");
|
|
var_dump($prop->getDefaultValue());
|
|
|
|
?>
|
|
--EXPECT--
|
|
int(1)
|