3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class Foo { static public $static_property; public $instance_property; public function instance_method() { echo $this->instance_property; } public static function static_method() { echo self::$static_property; } } Foo::$static_property = "static foo!<br>\n"; echo Foo::static_method(); $foo = new Foo(); $foo->instance_property = "instance property!<br>\n"; echo $foo->instance_method();
Output for 5.0.0 - 5.6.28, hhvm-3.10.0 - 3.13.2, 7.0.0 - 7.1.0
static foo!<br> instance property!<br>
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_STATIC, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/MbWDW on line 5
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected T_STATIC, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/MbWDW on line 5
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or `T_VAR' or `'}'' in /in/MbWDW on line 5
Process exited with code 255.