3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Core { protected static $_instance = null; public function __callStatic($method, $args) { if (static::$_instance === null) { static::$_instance = new static; } return call_user_func_array(array(static::$_instance, $method), $args) } } class ConstructCore extends Core { public function getModulesManager() { return 'manager'; } } var_dump(CostructCore::getModulesManager());
Output for 7.0.0
Parse error: syntax error, unexpected '}', expecting ';' in /in/qdBP8 on line 14
Process exited with code 255.
Output for 5.5.24 - 5.5.30, 5.6.8 - 5.6.16
Warning: The magic method __callStatic() must have public visibility and be static in /in/qdBP8 on line 7 Parse error: syntax error, unexpected '}' in /in/qdBP8 on line 14
Process exited with code 255.

preferences:
167.66 ms | 1387 KiB | 24 Q