3v4l.org

run code in 300+ PHP versions simultaneously
<?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();
Output for 5.4.0 - 5.4.12, 5.4.14
Parse error: syntax error, unexpected 'var11' (T_STRING), expecting variable (T_VARIABLE) in 2TMTL on line 5
Process exited with code 255.
Output for 5.4.13
Parse error: syntax error, unexpected 'var11' (T_STRING), expecting variable (T_VARIABLE) in /in/2TMTL on line 5
Process exited with code 255.
Output for 5.3.0 - 5.3.22, 5.3.24
Parse error: syntax error, unexpected T_STRING, expecting T_VARIABLE in 2TMTL on line 5
Process exited with code 255.
Output for 5.3.23
Parse error: syntax error, unexpected T_STRING, expecting T_VARIABLE in /in/tjjn4 on line 5
Process exited with code 255.

preferences:
180.34 ms | 1386 KiB | 47 Q