3v4l.org

run code in 300+ PHP versions simultaneously
<?php $all_pages = array( 'home' => 'Home', 'about' => 'About us', 'gallery' => array( 'photo-gallery' => 'Photo Gallery', 'video-gallery' => 'Video Gallery' ), 'contact' => 'Contact us' ); $new = []; array_walk_recursive($all_pages, function($value, $key) use (&$new) { $new[$key] = $value; }); print_r($new);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Aodi4
function name:  (null)
number of ops:  12
compiled vars:  !0 = $all_pages, !1 = $new
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   12     1        ASSIGN                                                   !1, <array>
   13     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                                                 
   14     8        INIT_FCALL                                               'print_r'
          9        SEND_VAR                                                 !1
         10        DO_ICALL                                                 
         11      > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Aodi4
function name:  {closure}
number of ops:  6
compiled vars:  !0 = $value, !1 = $key, !2 = $new
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        BIND_STATIC                                              !2
          3        ASSIGN_DIM                                               !2, !1
          4        OP_DATA                                                  !0
          5      > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
273.37 ms | 1006 KiB | 15 Q