3v4l.org

run code in 300+ PHP versions simultaneously
<?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.5.24 - 5.5.30, 5.6.8 - 5.6.16
Parse error: syntax error, unexpected '}' in /in/X6JCC on line 63
Process exited with code 255.

preferences:
168.16 ms | 1395 KiB | 25 Q