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($ticketName, '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 compact($system, $project, $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/RiCdC
function name:  (null)
number of ops:  8
compiled vars:  !0 = $s
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   ASSIGN                                                   !0, 'ASFX10'
   21     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/RiCdC
function name:  parseTicketName
number of ops:  36
compiled vars:  !0 = $ticketName, !1 = $sites, !2 = $system, !3 = $firstNumber, !4 = $project, !5 = $ticket_id
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        BIND_GLOBAL                                              !1, 'sites'
    5     2        INIT_FCALL                                               'substr'
          3        SEND_VAR                                                 !0
          4        SEND_VAL                                                 0
          5        SEND_VAL                                                 2
          6        DO_ICALL                                         $6      
          7        ASSIGN                                                   !2, $6
    6     8        INIT_FCALL                                               'substr'
          9        SEND_VAR                                                 !0
         10        SEND_VAL                                                 2
         11        DO_ICALL                                         $8      
         12        ASSIGN                                                   !0, $8
    9    13        INIT_FCALL                                               'strcspn'
         14        SEND_VAR                                                 !0
         15        SEND_VAL                                                 '0123456789'
         16        DO_ICALL                                         $10     
         17        ASSIGN                                                   !3, $10
   12    18        INIT_FCALL                                               'substr'
         19        SEND_VAR                                                 !0
         20        SEND_VAL                                                 0
         21        SEND_VAR                                                 !3
         22        DO_ICALL                                         $12     
         23        ASSIGN                                                   !4, $12
   15    24        INIT_FCALL                                               'substr'
         25        SEND_VAR                                                 !0
         26        SEND_VAR                                                 !3
         27        DO_ICALL                                         $14     
         28        ASSIGN                                                   !5, $14
   17    29        INIT_FCALL                                               'compact'
         30        SEND_VAR                                                 !2
         31        SEND_VAR                                                 !4
         32        SEND_VAR                                                 !5
         33        DO_ICALL                                         $16     
         34      > RETURN                                                   $16
   18    35*     > RETURN                                                   null

End of function parseticketname

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
187.07 ms | 1403 KiB | 22 Q