3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = array( array ( 0 => array ( 'norm_value' => 2.5, ), 1 => array ( 'norm_value' => 7.01, ), 2 => array ( 'norm_value' => 0.0, ), 3 => array ( 'norm_value' => 4.167, ), 4 => array ( 'norm_value' => 0.0, ), ), array ( 0 => array ( 'norm_value' => 0.0, ), 1 => array ( 'norm_value' => 0.0, ), 2 => array ( 'norm_value' => 0.0, ), 3 => array ( 'norm_value' => 1.267, ), 4 => array ( 'norm_value' => 0.0, ), ), array ( 0 => array ( 'norm_value' => 0.0, ), 1 => array ( 'norm_value' => 0.0, ), 2 => array ( 'norm_value' => 0.0, ), 3 => array ( 'norm_value' => 0.0, ), 4 => array ( 'norm_value' => 0.0, ), ), array ( 0 => array ( 'norm_value' => 3.54, ), 1 => array ( 'norm_value' => 2.04, ), 2 => array ( 'norm_value' => 0.673, ), 3 => array ( 'norm_value' => 8.546, ), 4 => array ( 'norm_value' => 0.0, ), ) ); $epsilon = 0.00001; foreach($arr as $index => $subarray){ $count = 0; foreach($subarray as $norm_data){ if(abs($norm_data['norm_value'] - 0.0) < $epsilon) $count++; } if($count === count($subarray) || $count == count($subarray)-1){ unset($arr[$index]); } } print_r($arr);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 28
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 28
Branch analysis from position: 4
2 jumps found. (Code = 77) Position 1 = 7, Position 2 = 17
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 17
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 16
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 16
Branch analysis from position: 17
2 jumps found. (Code = 47) Position 1 = 21, Position 2 = 25
Branch analysis from position: 21
2 jumps found. (Code = 43) Position 1 = 26, Position 2 = 27
Branch analysis from position: 26
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 27
Branch analysis from position: 25
Branch analysis from position: 17
Branch analysis from position: 28
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 28
filename:       /in/futQ8
function name:  (null)
number of ops:  33
compiled vars:  !0 = $arr, !1 = $epsilon, !2 = $subarray, !3 = $index, !4 = $count, !5 = $norm_data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   96     1        ASSIGN                                                   !1, 1.0e-5
   98     2      > FE_RESET_R                                       $8      !0, ->28
          3    > > FE_FETCH_R                                       ~9      $8, !2, ->28
          4    >   ASSIGN                                                   !3, ~9
   99     5        ASSIGN                                                   !4, 0
  100     6      > FE_RESET_R                                       $12     !2, ->17
          7    > > FE_FETCH_R                                               $12, !5, ->17
  101     8    >   INIT_FCALL                                               'abs'
          9        FETCH_DIM_R                                      ~13     !5, 'norm_value'
         10        SUB                                              ~14     ~13, 0
         11        SEND_VAL                                                 ~14
         12        DO_ICALL                                         $15     
         13        IS_SMALLER                                               $15, !1
         14      > JMPZ                                                     ~16, ->16
         15    >   PRE_INC                                                  !4
  100    16    > > JMP                                                      ->7
         17    >   FE_FREE                                                  $12
  104    18        COUNT                                            ~18     !2
         19        IS_IDENTICAL                                     ~19     !4, ~18
         20      > JMPNZ_EX                                         ~19     ~19, ->25
         21    >   COUNT                                            ~20     !2
         22        SUB                                              ~21     ~20, 1
         23        IS_EQUAL                                         ~22     !4, ~21
         24        BOOL                                             ~19     ~22
         25    > > JMPZ                                                     ~19, ->27
  105    26    >   UNSET_DIM                                                !0, !3
   98    27    > > JMP                                                      ->3
         28    >   FE_FREE                                                  $8
  109    29        INIT_FCALL                                               'print_r'
         30        SEND_VAR                                                 !0
         31        DO_ICALL                                                 
         32      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
320.41 ms | 1016 KiB | 15 Q