3v4l.org

run code in 300+ PHP versions simultaneously
<?php $input = [ [ 'Standort' => '', 'Letzte Meldung' => '', 'On-/Offline seit' => '04.05.2022 11:03', 'Online' => '', ], [ 'Standort' => 'Schweiz', 'Letzte Meldung' => '', 'On-/Offline seit' => '11.02.2022 14:59', 'Online' => '', ] ]; $keep = []; array_walk_recursive($input, function($v, $k) use(&$keep) { if (strlen($v)) { $keep[$k] = null; } }); var_export( $keep ? array_map(fn($row) => array_intersect_key($row, $keep), $input) : [] );
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 18
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NmK3V
function name:  (null)
number of ops:  22
compiled vars:  !0 = $input, !1 = $keep
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   18     1        ASSIGN                                                   !1, <array>
   19     2        INIT_FCALL                                               'array_walk_recursive'
          3        SEND_REF                                                 !0
          4        DECLARE_LAMBDA_FUNCTION                          ~4      [0]
          5        BIND_LEXICAL                                             ~4, !1
          6        SEND_VAL                                                 ~4
          7        DO_ICALL                                                 
   21     8        INIT_FCALL                                               'var_export'
   22     9      > JMPZ                                                     !1, ->18
         10    >   INIT_FCALL                                               'array_map'
         11        DECLARE_LAMBDA_FUNCTION                          ~6      [1]
         12        BIND_LEXICAL                                             ~6, !1
         13        SEND_VAL                                                 ~6
         14        SEND_VAR                                                 !0
         15        DO_ICALL                                         $7      
         16        QM_ASSIGN                                        ~8      $7
         17      > JMP                                                      ->19
         18    >   QM_ASSIGN                                        ~8      <array>
         19    >   SEND_VAL                                                 ~8
   21    20        DO_ICALL                                                 
   23    21      > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 7
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
filename:       /in/NmK3V
function name:  {closure}
number of ops:  8
compiled vars:  !0 = $v, !1 = $k, !2 = $keep
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        BIND_STATIC                                              !2
          3        STRLEN                                           ~3      !0
          4      > JMPZ                                                     ~3, ->7
          5    >   ASSIGN_DIM                                               !2, !1
          6        OP_DATA                                                  null
          7    > > RETURN                                                   null

End of Dynamic Function 0

Dynamic Function 1
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NmK3V
function name:  {closure}
number of ops:  8
compiled vars:  !0 = $row, !1 = $keep
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
          2        INIT_FCALL                                               'array_intersect_key'
          3        SEND_VAR                                                 !0
          4        SEND_VAR                                                 !1
          5        DO_ICALL                                         $2      
          6      > RETURN                                                   $2
          7*     > RETURN                                                   null

End of Dynamic Function 1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.25 ms | 1018 KiB | 17 Q