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 mGcD3

Shows result from various feature-branches currently under review from the php developers. Contact me to have additional branches featured.

Output for Typed properties v2
Fatal error: Class 'JiraTicketStatus' not found in /in/14QO2 on line 29
Output for Arrow functions
Fatal error: Class 'JiraTicketStatus' not found in /in/14QO2 on line 29

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page