3v4l.org

run code in 300+ PHP versions simultaneously
<?php $newArray = array ( 0 => 0.393, 1 => 0.769, 2 => 0.189, 3 => 0, 4 => 0, 5 => 0.349, 6 => 0.686, 7 => 0.168, 8 => 0, 9 => 0, 10 => 0.272, 11 => 0.534, 12 => 0.131, 13 => 1, 14 => 0 ); $out = array(); foreach ($newArray as $key => $value) { if ($key % 5 < 3) $out[] = $value; } print_r($out);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 11
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 11
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 10
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 10
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
filename:       /in/i3IIr
function name:  (null)
number of ops:  16
compiled vars:  !0 = $newArray, !1 = $out, !2 = $value, !3 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   21     1        ASSIGN                                                   !1, <array>
   22     2      > FE_RESET_R                                       $6      !0, ->11
          3    > > FE_FETCH_R                                       ~7      $6, !2, ->11
          4    >   ASSIGN                                                   !3, ~7
   23     5        MOD                                              ~9      !3, 5
          6        IS_SMALLER                                               ~9, 3
          7      > JMPZ                                                     ~10, ->10
          8    >   ASSIGN_DIM                                               !1
          9        OP_DATA                                                  !2
   22    10    > > JMP                                                      ->3
         11    >   FE_FREE                                                  $6
   25    12        INIT_FCALL                                               'print_r'
         13        SEND_VAR                                                 !1
         14        DO_ICALL                                                 
         15      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.9 ms | 1004 KiB | 14 Q