3v4l.org

run code in 500+ PHP versions simultaneously
<?php $array = array( 'a' => 'a', 'b' => null, 'c' => array( 'a' => null, 'b' => 'b', ), 'd' => array( 'a' => null ) ); $result = array_walk_recursive_delete($array); echo"<pre>"; print_r($result); echo"<pre>"; function array_walk_recursive_delete(array $array) { foreach ($array as $key => $value) { if (is_array($value)) { $value = array_walk_recursive_delete($value); } if ($value == null) { unset($array[$key]); } } return $array; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0ddOM
function name:  (null)
number of ops:  11
compiled vars:  !0 = $array, !1 = $result
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                       !0, <array>
   14     1        INIT_FCALL_BY_NAME                                           'array_walk_recursive_delete'
          2        SEND_VAR_EX                                                  !0
          3        DO_FCALL                                          0  $3      
          4        ASSIGN                                                       !1, $3
   16     5        ECHO                                                         '%3Cpre%3E'
   17     6        INIT_FCALL                                                   'print_r'
          7        SEND_VAR                                                     !1
          8        DO_ICALL                                                     
   18     9        ECHO                                                         '%3Cpre%3E'
   31    10      > RETURN                                                       1

Function array_walk_recursive_delete:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 14
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 14
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 10
Branch analysis from position: 6
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 13
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 13
Branch analysis from position: 10
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
filename:       /in/0ddOM
function name:  array_walk_recursive_delete
number of ops:  17
compiled vars:  !0 = $array, !1 = $value, !2 = $key
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   20     0  E >   RECV                                                 !0      
   21     1      > FE_RESET_R                                           $3      !0, ->14
          2    > > FE_FETCH_R                                           ~4      $3, !1, ->14
          3    >   ASSIGN                                                       !2, ~4
   22     4        TYPE_CHECK                                      128          !1
          5      > JMPZ                                                         ~6, ->10
   23     6    >   INIT_FCALL_BY_NAME                                           'array_walk_recursive_delete'
          7        SEND_VAR_EX                                                  !1
          8        DO_FCALL                                          0  $7      
          9        ASSIGN                                                       !1, $7
   25    10    >   IS_EQUAL                                                     !1, null
         11      > JMPZ                                                         ~9, ->13
   26    12    >   UNSET_DIM                                                    !0, !2
   21    13    > > JMP                                                          ->2
         14    >   FE_FREE                                                      $3
   30    15      > RETURN                                                       !0
   31    16*     > RETURN                                                       null

End of function array_walk_recursive_delete

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
172.33 ms | 2892 KiB | 14 Q