3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php abstract class PremiseFlags { const WIFI = 0x1; // (1) WiFi const PARKING = 0x2; // (2) Parkování const ACCESS_FOR_DISABLED = 0x4; // (4) Bezbariérový přístup const SUITABLE_FOR_CHILDREN = 0x8; // (8) Vhodné pro děti const ANIMALS_ALLOWED = 0x10; // (16) Domácí zvířata const CZECH_LANGUAGE = 0x20; // (32) Komunikace v českém jazyce const ONLINE_RESERVATION = 0x40; // (64) Možnost online rezervace const OWN_RESTAURANT = 0x80; // (128) Vlastní restaurace const REFRESHMENT = 0x100; // (256) Občerstvení const OUTDOOR_TABLES = 0x200; // (512) Letní zahrádka const CHILDRENS_CORNER = 0x400; // (1024) Dětský koutek const WELLNESS = 0x800; // (2048) Wellness const FITNESS = 0x1000; // (4096) Fitness const SHOWERS = 0x2000; // (8192) Možnost sprchy const OUTDOOR_POOL = 0x4000; // (16384) Venkovní bazén const INDOOR_POOL = 0x8000; // (32768) Vnitřní bazén const BICYCLE_STORAGE = 0x10000; // (65536) Kolárna const SKI_STORAGE = 0x20000; // (131072) Lyžárna /** * @return string[] */ public static function getNames() { static $names = array( self::WIFI => 'WiFi', self::PARKING => 'Parkování', self::ACCESS_FOR_DISABLED => 'Bezbariérový přístup', self::SUITABLE_FOR_CHILDREN => 'Vhodné pro děti', self::ANIMALS_ALLOWED => 'Domácí zvířata', self::CZECH_LANGUAGE => 'Komunikace v českém jazyce', self::ONLINE_RESERVATION => 'Možnost online rezervace', self::OWN_RESTAURANT => 'Vlastní restaurace', self::REFRESHMENT => 'Občerstvení', self::OUTDOOR_TABLES => 'Letní zahrádka', self::CHILDRENS_CORNER => 'Dětský koutek', self::WELLNESS => 'Wellness', self::FITNESS => 'Fitness', self::SHOWERS => 'Možnost sprchy', self::OUTDOOR_POOL => 'Venkovní bazén', self::INDOOR_POOL => 'Vnitřní bazén', self::BICYCLE_STORAGE => 'Kolárna', self::SKI_STORAGE => 'Lyžárna', ); return $names; } /** * @param string * @return string */ public static function getName($value) { return self::getNames()[$value]; } } $a = PremiseFlags::getName(PremiseFlags::FITTNESS); var_dump($a);
Output for 7.0.0 - 7.1.0
Fatal error: Uncaught Error: Undefined class constant 'FITTNESS' in /in/YqVei:65 Stack trace: #0 {main} thrown in /in/YqVei on line 65
Process exited with code 255.
Output for hhvm-3.10.0 - 3.12.0
Fatal error: Couldn't find constant PremiseFlags::FITTNESS in /in/YqVei on line 65
Process exited with code 255.
Output for 5.4.0 - 5.6.28
Fatal error: Undefined class constant 'FITTNESS' in /in/YqVei on line 65
Process exited with code 255.
Output for 5.1.0 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/YqVei on line 60
Process exited with code 255.
Output for 5.0.0 - 5.0.5
Parse error: parse error, unexpected '[' in /in/YqVei on line 60
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_CLASS in /in/YqVei on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected T_CLASS in /in/YqVei on line 3
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/YqVei on line 3
Process exited with code 255.