3v4l.org

run code in 300+ PHP versions simultaneously
<?php function parseTicketName($ticketName) { global $sites; $system = substr($ticketName, 0, 2); // pull out managment system $ticketName = substr($ticketName, 2); // remove management system // Find first occurence of number $firstNumber = strcspn($ticketName, '0123456789'); // Get project name $project = substr($ticketName, 0, $firstNumber); // Get ticket ID $ticket_id = substr($ticketName, $firstNumber); // remove project, and only thing left is ticket ID return compact($system, $project, $ticket_id); } $s = "ASFX10"; var_dump(parseTicketName($s));
Output for git.master, git.master_jit, rfc.property-hooks
Warning: compact(): Undefined variable $AS in /in/RiCdC on line 17 Warning: compact(): Undefined variable $FX in /in/RiCdC on line 17 Warning: compact(): Undefined variable $10 in /in/RiCdC on line 17 array(0) { }

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:
43.38 ms | 401 KiB | 8 Q