3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class A { public static $foo = 'hello'; } class B extends A { public static $foo = '!'; } $a1 = new A; $a2 = new A; $b = new B; var_dump($a1::$foo); var_dump($a2::$foo); var_dump($b::$foo); $a1::$foo = '123'; var_dump($a1::$foo); var_dump($a2::$foo); var_dump($b::$foo);
Output for 5.6.38 - 7.3.0rc3
string(5) "hello" string(5) "hello" string(1) "!" string(3) "123" string(3) "123" string(1) "!"