3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?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:]]+)$/', $str, $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 7.0.0 - 7.1.0
Notice: Undefined variable: ticket in /in/GrPWi on line 5 Notice: Undefined variable: str in /in/GrPWi on line 8 Notice: Undefined offset: 1 in /in/GrPWi on line 12 Notice: Undefined offset: 2 in /in/GrPWi on line 13 array(3) { ["system"]=> string(0) "" ["project"]=> NULL ["ticket_id"]=> NULL }
Output for hhvm-3.12.0
Notice: Undefined variable: ticket in /in/GrPWi on line 5 Warning: substr() expects parameter 1 to be string, null given in /in/GrPWi on line 5 Notice: Undefined variable: str in /in/GrPWi on line 8 Warning: preg_match() expects parameter 2 to be string, null given in /in/GrPWi on line 8 array(3) { ["system"]=> NULL ["project"]=> NULL ["ticket_id"]=> NULL }
Output for hhvm-3.10.0
Notice: Undefined variable: ticket in /in/GrPWi on line 5 Notice: Undefined variable: str in /in/GrPWi on line 8 Notice: Undefined index: 1 in /in/GrPWi on line 12 Notice: Undefined index: 2 in /in/GrPWi on line 13 array(3) { ["system"]=> bool(false) ["project"]=> NULL ["ticket_id"]=> NULL }
Output for 5.3.0 - 5.6.28
Notice: Undefined variable: ticket in /in/GrPWi on line 5 Notice: Undefined variable: str in /in/GrPWi on line 8 Notice: Undefined offset: 1 in /in/GrPWi on line 12 Notice: Undefined offset: 2 in /in/GrPWi on line 13 array(3) { ["system"]=> bool(false) ["project"]=> NULL ["ticket_id"]=> NULL }
Output for 5.0.4 - 5.2.17
Notice: Undefined variable: ticket in /in/GrPWi on line 5 Notice: Undefined variable: str in /in/GrPWi on line 8 Notice: Undefined offset: 1 in /in/GrPWi on line 12 Notice: Undefined offset: 2 in /in/GrPWi on line 13 array(3) { ["system"]=> bool(false) ["project"]=> NULL ["ticket_id"]=> NULL }
Output for 4.3.0 - 5.0.3
Notice: Undefined variable: ticket in /in/GrPWi on line 5 Notice: Undefined variable: str in /in/GrPWi on line 8 Notice: Undefined offset: 1 in /in/GrPWi on line 12 Notice: Undefined offset: 2 in /in/GrPWi on line 13 array(3) { ["system"]=> bool(false) ["project"]=> NULL ["ticket_id"]=> NULL }