3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getVehicleType($id, $types) { $types = explode(';', $types); foreach ($types as $type) { $type = substr($type, 0, 1); echo $type; } echo print_r($types); } getVehicleType(1, '1 - teste;2 - teste;3 - teste;'); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Cq3Gq
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   INIT_FCALL                                               'getvehicletype'
          1        SEND_VAL                                                 1
          2        SEND_VAL                                                 '1+-+teste%3B2+-+teste%3B3+-+teste%3B'
          3        DO_FCALL                                      0          
   16     4      > RETURN                                                   1

Function getvehicletype:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 8, Position 2 = 17
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 17
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
filename:       /in/Cq3Gq
function name:  getVehicleType
number of ops:  23
compiled vars:  !0 = $id, !1 = $types, !2 = $type
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    4     2        INIT_FCALL                                               'explode'
          3        SEND_VAL                                                 '%3B'
          4        SEND_VAR                                                 !1
          5        DO_ICALL                                         $3      
          6        ASSIGN                                                   !1, $3
    6     7      > FE_RESET_R                                       $5      !1, ->17
          8    > > FE_FETCH_R                                               $5, !2, ->17
    7     9    >   INIT_FCALL                                               'substr'
         10        SEND_VAR                                                 !2
         11        SEND_VAL                                                 0
         12        SEND_VAL                                                 1
         13        DO_ICALL                                         $6      
         14        ASSIGN                                                   !2, $6
    8    15        ECHO                                                     !2
    6    16      > JMP                                                      ->8
         17    >   FE_FREE                                                  $5
   11    18        INIT_FCALL                                               'print_r'
         19        SEND_VAR                                                 !1
         20        DO_ICALL                                         $8      
         21        ECHO                                                     $8
   12    22      > RETURN                                                   null

End of function getvehicletype

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
127.08 ms | 1403 KiB | 20 Q