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 // 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 $ticket in /in/Siv9J on line 5 Deprecated: substr(): Passing null to parameter #1 ($string) of type string is deprecated in /in/Siv9J on line 5 Warning: Undefined variable $str in /in/Siv9J on line 9 Deprecated: strcspn(): Passing null to parameter #1 ($string) of type string is deprecated in /in/Siv9J on line 9 Fatal error: Uncaught Error: Call to undefined function compat() in /in/Siv9J:17 Stack trace: #0 /in/Siv9J(21): parseTicketName('FX10') #1 {main} thrown in /in/Siv9J 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:
37.34 ms | 401 KiB | 8 Q