3v4l.org

run code in 300+ PHP versions simultaneously
<?php $dataArray = array( array( 20800, 21679, 0 ), array( 15254, 0, 3726 ), array( 17426, 2973, 0 ), array( 4391, 37, 0 ), array( 39194, 435, 0 ) ); $position = array(); $binary = array(); foreach ($dataArray as $row => $data) { // if you want to have the positions start at 1 instead of 0 // add a dummy value to the final array $binary[$row][] = 0; foreach ($data as $key => $value) { if($value > 1999) { $binary[$row][] = 1; } else { $binary[$row][] = 0; } } $positions[] = array_keys($binary[$row], 1); } var_dump($positions);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 31
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 31
Branch analysis from position: 5
2 jumps found. (Code = 77) Position 1 = 10, Position 2 = 22
Branch analysis from position: 10
2 jumps found. (Code = 78) Position 1 = 11, Position 2 = 22
Branch analysis from position: 11
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 18
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
Branch analysis from position: 22
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 22
Branch analysis from position: 31
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 31
filename:       /in/YrPR7
function name:  (null)
number of ops:  36
compiled vars:  !0 = $dataArray, !1 = $position, !2 = $binary, !3 = $data, !4 = $row, !5 = $value, !6 = $key, !7 = $positions
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
   10     1        ASSIGN                                                   !1, <array>
   11     2        ASSIGN                                                   !2, <array>
   13     3      > FE_RESET_R                                       $11     !0, ->31
          4    > > FE_FETCH_R                                       ~12     $11, !3, ->31
          5    >   ASSIGN                                                   !4, ~12
   17     6        FETCH_DIM_W                                      $14     !2, !4
          7        ASSIGN_DIM                                               $14
          8        OP_DATA                                                  0
   19     9      > FE_RESET_R                                       $16     !3, ->22
         10    > > FE_FETCH_R                                       ~17     $16, !5, ->22
         11    >   ASSIGN                                                   !6, ~17
   20    12        IS_SMALLER                                               1999, !5
         13      > JMPZ                                                     ~19, ->18
   21    14    >   FETCH_DIM_W                                      $20     !2, !4
         15        ASSIGN_DIM                                               $20
         16        OP_DATA                                                  1
         17      > JMP                                                      ->21
   23    18    >   FETCH_DIM_W                                      $22     !2, !4
         19        ASSIGN_DIM                                               $22
         20        OP_DATA                                                  0
   19    21    > > JMP                                                      ->10
         22    >   FE_FREE                                                  $16
   26    23        INIT_FCALL                                               'array_keys'
         24        FETCH_DIM_R                                      ~25     !2, !4
         25        SEND_VAL                                                 ~25
         26        SEND_VAL                                                 1
         27        DO_ICALL                                         $26     
         28        ASSIGN_DIM                                               !7
         29        OP_DATA                                                  $26
   13    30      > JMP                                                      ->4
         31    >   FE_FREE                                                  $11
   29    32        INIT_FCALL                                               'var_dump'
         33        SEND_VAR                                                 !7
         34        DO_ICALL                                                 
         35      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
173.55 ms | 1400 KiB | 17 Q