3v4l.org

run code in 300+ PHP versions simultaneously
<?php function parseTicketName($ticketName) { preg_match('/([[:alpha:]]{2})([[:alpha:]]+)(B|F)([[:digit:]]+)$/iu', $ticketName, $matches); var_dump($matches); exit; return array( 'system' => $matches[1], 'project' => $matches[2], 'ticket_id' => $matches[3] ); } // 2 first characters is system, then the next letters are project name and the numbers are the ticket id $s = "ASFXf10"; var_dump(parseTicketName($s));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sYa8r
function name:  (null)
number of ops:  8
compiled vars:  !0 = $s
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   ASSIGN                                                   !0, 'ASFXf10'
   15     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 = 79) Position 1 = -2
filename:       /in/sYa8r
function name:  parseTicketName
number of ops:  18
compiled vars:  !0 = $ticketName, !1 = $matches
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        INIT_FCALL                                               'preg_match'
          2        SEND_VAL                                                 '%2F%28%5B%5B%3Aalpha%3A%5D%5D%7B2%7D%29%28%5B%5B%3Aalpha%3A%5D%5D%2B%29%28B%7CF%29%28%5B%5B%3Adigit%3A%5D%5D%2B%29%24%2Fiu'
          3        SEND_VAR                                                 !0
          4        SEND_REF                                                 !1
          5        DO_ICALL                                                 
    5     6        INIT_FCALL                                               'var_dump'
          7        SEND_VAR                                                 !1
          8        DO_ICALL                                                 
          9      > EXIT                                                     
    7    10*       FETCH_DIM_R                                      ~4      !1, 1
         11*       INIT_ARRAY                                       ~5      ~4, 'system'
    8    12*       FETCH_DIM_R                                      ~6      !1, 2
         13*       ADD_ARRAY_ELEMENT                                ~5      ~6, 'project'
    9    14*       FETCH_DIM_R                                      ~7      !1, 3
         15*       ADD_ARRAY_ELEMENT                                ~5      ~7, 'ticket_id'
         16*       RETURN                                                   ~5
   11    17*     > RETURN                                                   null

End of function parseticketname

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.47 ms | 1390 KiB | 18 Q