3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getVehicleType($id, $types) { $types = explode(';', $types); foreach ($types as $key => $type) { $types[$key] = substr($type, 0, 1); if ($types[$key] == $id) return true; } } echo 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/VAMDQ
function name:  (null)
number of ops:  6
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  $0      
          4        ECHO                                                     $0
   16     5      > RETURN                                                   1

Function getvehicletype:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 8, Position 2 = 23
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 23
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 20, Position 2 = 22
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 23
filename:       /in/VAMDQ
function name:  getVehicleType
number of ops:  25
compiled vars:  !0 = $id, !1 = $types, !2 = $type, !3 = $key
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                                         $4      
          6        ASSIGN                                                   !1, $4
    6     7      > FE_RESET_R                                       $6      !1, ->23
          8    > > FE_FETCH_R                                       ~7      $6, !2, ->23
          9    >   ASSIGN                                                   !3, ~7
    7    10        INIT_FCALL                                               'substr'
         11        SEND_VAR                                                 !2
         12        SEND_VAL                                                 0
         13        SEND_VAL                                                 1
         14        DO_ICALL                                         $10     
         15        ASSIGN_DIM                                               !1, !3
         16        OP_DATA                                                  $10
    9    17        FETCH_DIM_R                                      ~11     !1, !3
         18        IS_EQUAL                                                 !0, ~11
         19      > JMPZ                                                     ~12, ->22
   10    20    >   FE_FREE                                                  $6
         21      > RETURN                                                   <true>
    6    22    > > JMP                                                      ->8
         23    >   FE_FREE                                                  $6
   12    24      > RETURN                                                   null

End of function getvehicletype

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
197.92 ms | 1399 KiB | 18 Q