3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
157.63 ms | 2010 KiB | 14 Q