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 preg_match('/([[:alpha:]]2)^([[: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));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/62dah
function name:  (null)
number of ops:  8
compiled vars:  !0 = $s
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   ASSIGN                                                   !0, 'ASFX10'
   19     1        INIT_FCALL                                               'var_dump'
          2        INIT_FCALL                                               'parseticketname'
          3        SEND_VAR                                                 !0
          4        DO_FCALL                                      0  $2      
          5        SEND_VAR                                                 $2
          6        DO_ICALL                                                 
          7      > RETURN                                                   1

Function parseticketname:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/62dah
function name:  parseTicketName
number of ops:  14
compiled vars:  !0 = $ticketName, !1 = $sites, !2 = $matches, !3 = $system
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        BIND_GLOBAL                                              !1, 'sites'
    8     2        INIT_FCALL                                               'preg_match'
          3        SEND_VAL                                                 '%2F%28%5B%5B%3Aalpha%3A%5D%5D2%29%5E%28%5B%5B%3Aalpha%3A%5D%5D%2B%29%28%5B%5B%3Adigit%3A%5D%5D%2B%29%24%2F'
          4        SEND_VAR                                                 !0
          5        SEND_REF                                                 !2
          6        DO_ICALL                                                 
   11     7        INIT_ARRAY                                       ~5      !3, 'system'
   12     8        FETCH_DIM_R                                      ~6      !2, 1
          9        ADD_ARRAY_ELEMENT                                ~5      ~6, 'project'
   13    10        FETCH_DIM_R                                      ~7      !2, 2
         11        ADD_ARRAY_ELEMENT                                ~5      ~7, 'ticket_id'
         12      > RETURN                                                   ~5
   15    13*     > RETURN                                                   null

End of function parseticketname

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
173.74 ms | 1389 KiB | 18 Q