3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { public static $x = 0; } class Test2 extends Test { // $x is inherited } class Test3 extends Test { // $x is NOT inherited public static $x = 3; } $x = 1; Test2::$x = &$x; var_dump(Test::$x, Test2::$x, Test3::$x); // int(1), int(1), int(3) ?>

preferences:
53.95 ms | 844 KiB | 5 Q