3v4l.org

run code in 300+ PHP versions simultaneously
<?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 8.0.0 - 8.0.30, 8.1.0 - 8.1.27, 8.2.0 - 8.2.17, 8.3.0 - 8.3.4
Fatal error: Uncaught Error: Undefined constant PremiseFlags::FITTNESS in /in/YqVei:65 Stack trace: #0 {main} thrown in /in/YqVei on line 65
Process exited with code 255.
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.20, 7.2.6 - 7.2.33, 7.3.12 - 7.3.33, 7.4.0 - 7.4.33
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 5.4.0 - 5.4.45, 5.5.24 - 5.5.35, 5.6.7 - 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.1.6, 5.2.0 - 5.2.17, 5.3.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.3.11, 4.4.0 - 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.

preferences:
192.14 ms | 401 KiB | 310 Q