3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class ServerName { /** * All the Adjectives * * @var array */ public static $allTheAdjectives = [ 'magic', 'blazing', 'dark', 'empty', 'super', 'royal', 'super', 'limitless', 'obsidian', 'light', 'shining', 'glowing', ]; /** * All the Nouns * * @var array */ public static $allTheNouns = [ 'nebula', 'spectrum', 'earth', 'jupiter', 'comet', 'asteroid', 'comet', 'cosmos', 'ecliptic', 'galaxy', 'planet', 'planetoid', 'quasar', 'sky', 'star', 'nova', 'orion', 'meteor', 'moon', 'orbit', ]; /** * The Adjective * * @var string */ public $adjective = ''; /** * The Noun * * @var string */ public $noun = ''; /** * __construct */ public function __construct() { $this->generate(); } /** * Returns the Server in Title Case * * @return */ public function title() { return ucwords($this->adjective.' '.$this->noun); } /** * Returns the Server in Title Case * * @return */ public function slug() { return strtolower($this->adjective.'-'.$this->noun) } /** * Generate a Random Server Name */ private function generate() { $this->adjective = self::$allTheAdjectives[mt_rand(0, count(self::$allTheAdjectives) - 1)]; $this->noun = self::$allTheNouns[mt_rand(0, count(self::$allTheNouns) - 1)]; } } $server = new ServerName(); echo $server->title() . ' - (' . $server->slug() . ')';
Output for 7.0.0 - 7.0.1
Parse error: syntax error, unexpected '}', expecting ';' in /in/X6JCC on line 63
Process exited with code 255.
Output for 5.4.11 - 5.6.16
Parse error: syntax error, unexpected '}' in /in/X6JCC on line 63
Process exited with code 255.
Output for 5.3.21 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/X6JCC on line 10
Process exited with code 255.