3v4l.org

run code in 500+ PHP versions simultaneously
<?php $array = ['a', 'a', 'a', 'b', 'c', 'd', 'e']; $del_var = 'a'; for ($i = 0; $i < count($array); $i++) { if ($array[$i] === $del_var) { unset($array[$i]); break; } } print_r($array);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
2 jumps found. (Code = 44) Position 1 = 13, Position 2 = 4
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 9
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
Branch analysis from position: 9
2 jumps found. (Code = 44) Position 1 = 13, Position 2 = 4
Branch analysis from position: 13
Branch analysis from position: 4
filename:       /in/cXAT4
function name:  (null)
number of ops:  17
compiled vars:  !0 = $array, !1 = $del_var, !2 = $i
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
    4     1        ASSIGN                                                       !1, 'a'
    5     2        ASSIGN                                                       !2, 0
          3      > JMP                                                          ->10
    6     4    >   FETCH_DIM_R                                          ~6      !0, !2
          5        IS_IDENTICAL                                                 !1, ~6
          6      > JMPZ                                                         ~7, ->9
    7     7    >   UNSET_DIM                                                    !0, !2
    8     8      > JMP                                                          ->13
    5     9    >   PRE_INC                                                      !2
         10    >   COUNT                                                ~9      !0
         11        IS_SMALLER                                                   !2, ~9
         12      > JMPNZ                                                        ~10, ->4
   12    13    >   INIT_FCALL                                                   'print_r'
         14        SEND_VAR                                                     !0
         15        DO_ICALL                                                     
         16      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
167.28 ms | 2156 KiB | 14 Q