3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class JiraStatusMapper { /** * @var array */ protected static $map = [ 0 => JiraTicketStatus::OPEN, ]; /** * @param int $id * * @return string */ public static function getJiraStatusByPackageStatusId(int $id) { $status = self::$map[$id]; if (!$status) { throw new \OutOfRangeException(); } return $status; } } $x = new JiraStatusMapper(); var_dump($x::getJiraStatusByPackageStatusId(0));
based on J0aSP
Output for 7.3.0 - 7.3.1
Fatal error: Uncaught Error: Class 'JiraTicketStatus' not found in /in/mGcD3:29 Stack trace: #0 {main} thrown in /in/mGcD3 on line 29
Process exited with code 255.
Output for 5.6.0 - 5.6.38, 7.0.0 - 7.2.13
Fatal error: Class 'JiraTicketStatus' not found in /in/mGcD3 on line 29
Process exited with code 255.
Output for hhvm-3.15.4
Fatal error: Uncaught Error: Class undefined: JiraTicketStatus in /in/mGcD3:9 Stack trace: #0 {main}
Process exited with code 255.