3v4l.org

run code in 300+ PHP versions simultaneously
<?php $nu_array = null; $callback = function ( $item ) use(&$callback, &$nu_array) { if (!is_array($item)) { $nu_array[] = $item; } else if ( is_array( $item ) ) { foreach( array_values($item) as $v) { if ( !(is_array($v))) { $nu_array[] = $v; } else { $callback( $v ); continue; } } } }; $array = array( 'a',array(1,2), 'b',array(3,4, array(5,6, array('c', array(7,8)))) ); array_walk($array, $callback); print_r($nu_array); /** Array ( ) **/
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/IZ1aG
function name:  (null)
number of ops:  14
compiled vars:  !0 = $nu_array, !1 = $callback, !2 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, null
    3     1        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FIZ1aG%3A3%240'
          2        BIND_LEXICAL                                             ~4, !1
          3        BIND_LEXICAL                                             ~4, !0
          4        ASSIGN                                                   !1, ~4
   21     5        ASSIGN                                                   !2, <array>
   24     6        INIT_FCALL                                               'array_walk'
          7        SEND_REF                                                 !2
          8        SEND_VAR                                                 !1
          9        DO_ICALL                                                 
   25    10        INIT_FCALL                                               'print_r'
         11        SEND_VAR                                                 !0
         12        DO_ICALL                                                 
   31    13      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FIZ1aG%3A3%240:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 9
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 28
Branch analysis from position: 28
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 28
Branch analysis from position: 11
2 jumps found. (Code = 77) Position 1 = 15, Position 2 = 27
Branch analysis from position: 15
2 jumps found. (Code = 78) Position 1 = 16, Position 2 = 27
Branch analysis from position: 16
2 jumps found. (Code = 43) Position 1 = 19, Position 2 = 22
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 26
Branch analysis from position: 26
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
Branch analysis from position: 22
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
Branch analysis from position: 27
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 27
Branch analysis from position: 28
filename:       /in/IZ1aG
function name:  {closure}
number of ops:  29
compiled vars:  !0 = $item, !1 = $callback, !2 = $nu_array, !3 = $v
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
          2        BIND_STATIC                                              !2
    4     3        TYPE_CHECK                                  128  ~4      !0
          4        BOOL_NOT                                         ~5      ~4
          5      > JMPZ                                                     ~5, ->9
    5     6    >   ASSIGN_DIM                                               !2
          7        OP_DATA                                                  !0
          8      > JMP                                                      ->28
    8     9    >   TYPE_CHECK                                  128          !0
         10      > JMPZ                                                     ~7, ->28
    9    11    >   INIT_FCALL                                               'array_values'
         12        SEND_VAR                                                 !0
         13        DO_ICALL                                         $8      
         14      > FE_RESET_R                                       $9      $8, ->27
         15    > > FE_FETCH_R                                               $9, !3, ->27
   10    16    >   TYPE_CHECK                                  128  ~10     !3
         17        BOOL_NOT                                         ~11     ~10
         18      > JMPZ                                                     ~11, ->22
   11    19    >   ASSIGN_DIM                                               !2
         20        OP_DATA                                                  !3
         21      > JMP                                                      ->26
   15    22    >   INIT_DYNAMIC_CALL                                        !1
         23        SEND_VAR_EX                                              !3
         24        DO_FCALL                                      0          
   16    25      > JMP                                                      ->15
    9    26    > > JMP                                                      ->15
         27    >   FE_FREE                                                  $9
   20    28    > > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FIZ1aG%3A3%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.26 ms | 1392 KiB | 19 Q