3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Only the static methods shall be called using the static call syntax class Config { protected static $config = array(); public function get($name) { return static::$config[$name]; } public function set($name, $value) { static::$config[$name] = $value; } } error_reporting(-1); Config::set("xxx", "yyy"); // Error - Config::set is not marked as static print(Config::get("xxx")."\n"); // Error - Config::get is not marked as static

preferences:
38.14 ms | 402 KiB | 5 Q