3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class foo { public static var11; public function printItem($string) { echo 'Foo: ' . $string . PHP_EOL; } public function printPHP() { echo 'PHP is great.' . PHP_EOL; } } class bar extends foo { public static var11 = 'foo_var'; public function printItem($string) { echo 'Bar: ' . $string . PHP_EOL; } } $foo = new foo(); $bar = new bar(); $bar->printItem('baz');
Output for 5.4.0 - 5.4.14
Parse error: syntax error, unexpected 'var11' (T_STRING), expecting variable (T_VARIABLE) in /in/aKrg7 on line 5
Process exited with code 255.
Output for 5.3.0 - 5.3.24
Parse error: syntax error, unexpected T_STRING, expecting T_VARIABLE in /in/aKrg7 on line 5
Process exited with code 255.