3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php error_reporting(E_ALL & E_STRICT); ini_set('display_errors', 'on'); interface ConfigInterface { public static function get($key); public static function set($key, $value); public static function clear(); } class Config implements ConfigInterface { public static $data = []; public static function get($key) { return self::$data[$key]; } public static function set($key, $value) { self::$data[$key] = $value; } public static function clear() { self::$data = []; } } $config = new Config; $config->set('alma', 'banan'); echo $config->get('alma');
based on 5lOH1
Output for 5.4.9 - 7.2.0
banan
Output for 5.3.19 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/HkCGV on line 10
Process exited with code 255.