3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class foo { public static $var_1 = 'foo_var'; public function printItem($string) { echo 'Foo: ' . $string . PHP_EOL; } public function printPHP() { echo 'PHP is great.' . PHP_EOL; } } class bar extends foo { public static $var_1 = 'bar_var'; public static function printItem($string) { echo 'Bar: ' . self::$var_1 . PHP_EOL; } } bar::printItem('baz');
Output for 5.3.0 - 5.4.14
Fatal error: Cannot make non static method foo::printItem() static in class bar in /in/g3O0o on line 23
Process exited with code 255.