3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Foo { static $abc; function __construct() { var_dump(self::$abc); } } class Bar extends Foo { } $rf = new ReflectionClass('Bar'); $rf->setStaticPropertyValue('abc', 'hi2'); $foo = $rf->newInstance();
based on bbDYh
Output for 5.3.20 - 5.6.28, 7.0.1 - 7.2.0
string(3) "hi2"
Output for 7.0.0
NULL