3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ 0 => [ "label" => "Radiator", "details" => [[ "label" => "Condition", "value" => "New", ], [ "label" => "Type", "value" => "Wall", ]], ], 1 => [ "label" => "Airco", "details" => [[ "label" => "Condition", "value" => "New", ], [ "label" => "Type", "value" => "", ]], ], 2 => [ "label" => "Refrigerator", "details" => [[ "label" => "Condition", "value" => "Bad", ], [ "label" => "Type", "value" => "Wall", ]], ], ]; foreach($array as &$row){ foreach($row['details'] as $key => $record){ if(strlen($record['value']) == 0){ unset($row['details'][$key]); } } } print_r($array);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 125) Position 1 = 2, Position 2 = 16
Branch analysis from position: 2
2 jumps found. (Code = 126) Position 1 = 3, Position 2 = 16
Branch analysis from position: 3
2 jumps found. (Code = 77) Position 1 = 5, Position 2 = 14
Branch analysis from position: 5
2 jumps found. (Code = 78) Position 1 = 6, Position 2 = 14
Branch analysis from position: 6
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 13
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
Branch analysis from position: 13
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 14
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
filename:       /in/ac0ip
function name:  (null)
number of ops:  21
compiled vars:  !0 = $array, !1 = $row, !2 = $record, !3 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   40     1      > FE_RESET_RW                                      $5      !0, ->16
          2    > > FE_FETCH_RW                                              $5, !1, ->16
   41     3    >   FETCH_DIM_R                                      ~6      !1, 'details'
          4      > FE_RESET_R                                       $7      ~6, ->14
          5    > > FE_FETCH_R                                       ~8      $7, !2, ->14
          6    >   ASSIGN                                                   !3, ~8
   42     7        FETCH_DIM_R                                      ~10     !2, 'value'
          8        STRLEN                                           ~11     ~10
          9        IS_EQUAL                                                 ~11, 0
         10      > JMPZ                                                     ~12, ->13
   43    11    >   FETCH_DIM_UNSET                                  $13     !1, 'details'
         12        UNSET_DIM                                                $13, !3
   41    13    > > JMP                                                      ->5
         14    >   FE_FREE                                                  $7
   40    15      > JMP                                                      ->2
         16    >   FE_FREE                                                  $5
   48    17        INIT_FCALL                                               'print_r'
         18        SEND_VAR                                                 !0
         19        DO_ICALL                                                 
         20      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
138.17 ms | 1445 KiB | 14 Q