3v4l.org

run code in 300+ PHP versions simultaneously
<?php function parseTicketName($ticketName) { global $sites; $system = substr($ticket, 0, 2); // pull out managment system $ticketName = substr($ticketName, 2); // remove management system preg_match('/^([[:alpha:]]+)([[:digit:]]+)$/', $ticketName, $matches); return array( 'system' => $system, 'project' => $matches[1], 'ticket_id' => $matches[2] ); } // 2 first characters is system, then the next letters are project name and the numbers are the ticket id $s = "ASFX10"; var_dump(parseTicketName($s));
Output for git.master, git.master_jit, rfc.property-hooks
Warning: Undefined variable $ticket in /in/ffZL7 on line 5 Deprecated: substr(): Passing null to parameter #1 ($string) of type string is deprecated in /in/ffZL7 on line 5 array(3) { ["system"]=> string(0) "" ["project"]=> string(2) "FX" ["ticket_id"]=> string(2) "10" }

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

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


preferences:
41.37 ms | 401 KiB | 8 Q