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 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/8JqvK
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   INIT_FCALL                                               'getvehicletype'
          1        SEND_VAL                                                 1
          2        SEND_VAL                                                 '1+-+teste%3B2+-+teste%3B3+-+teste%3B'
          3        DO_FCALL                                      0          
   15     4      > RETURN                                                   1

Function getvehicletype:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 8, Position 2 = 16
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 16
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
filename:       /in/8JqvK
function name:  getVehicleType
number of ops:  22
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, ->16
          8    > > FE_FETCH_R                                               $5, !2, ->16
    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
    6    15      > JMP                                                      ->8
         16    >   FE_FREE                                                  $5
   10    17        INIT_FCALL                                               'print_r'
         18        SEND_VAR                                                 !1
         19        DO_ICALL                                         $8      
         20        ECHO                                                     $8
   11    21      > RETURN                                                   null

End of function getvehicletype

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.17 ms | 1390 KiB | 20 Q