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($str, '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 compat($system, $project, $ticket_id); } $s = "ASFX10"; var_dump(parseTicketName($s));
Output for git.master, git.master_jit, rfc.property-hooks
Warning: Undefined variable $str in /in/NCIvK on line 9 Deprecated: strcspn(): Passing null to parameter #1 ($string) of type string is deprecated in /in/NCIvK on line 9 Fatal error: Uncaught Error: Call to undefined function compat() in /in/NCIvK:17 Stack trace: #0 /in/NCIvK(21): parseTicketName('FX10') #1 {main} thrown in /in/NCIvK on line 17
Process exited with code 255.

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.12 ms | 405 KiB | 9 Q