1
0
mirror of https://github.com/php/php-src.git synced 2026-03-25 16:52:18 +01:00
Files
archived-php-src/ext/reflection/tests/bug80821.phpt
Nikita Popov 3eb97a4566 Always use separate static_members_table
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.
2021-07-23 09:29:32 +02:00

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)