3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = array( 'indexColor' => '#0FF0FF', 'faviURL' => get_stylesheet_directory_uri() . '/favicon.ico', 'secondColor' => '#0FFF0F', 'background' => array( 'image' => NULL, 'color' => '#DDDDDD', 'repeat' => 'no-repeat' ), 'blog' => array( 'animations' => array( 'title_classes' => 'wow animated fadeIn' ) ), 'sidebar' => array( 'position' => 'right' ) ); function flatten_array(array $array) { $flattened_array = array(); array_walk_recursive($array, function($a) use (&$flattened_array) { $flattened_array[] = $a; }); return $flattened_array; } print_r(flatten_array($arr));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XPiM6
function name:  (null)
number of ops:  17
compiled vars:  !0 = $arr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_ARRAY                                       ~1      '%230FF0FF', 'indexColor'
    4     1        INIT_FCALL_BY_NAME                                       'get_stylesheet_directory_uri'
          2        DO_FCALL                                      0  $2      
          3        CONCAT                                           ~3      $2, '%2Ffavicon.ico'
          4        ADD_ARRAY_ELEMENT                                ~1      ~3, 'faviURL'
    5     5        ADD_ARRAY_ELEMENT                                ~1      '%230FFF0F', 'secondColor'
    3     6        ADD_ARRAY_ELEMENT                                ~1      <array>, 'background'
          7        ADD_ARRAY_ELEMENT                                ~1      <array>, 'blog'
          8        ADD_ARRAY_ELEMENT                                ~1      <array>, 'sidebar'
    2     9        ASSIGN                                                   !0, ~1
   27    10        INIT_FCALL                                               'print_r'
         11        INIT_FCALL                                               'flatten_array'
         12        SEND_VAR                                                 !0
         13        DO_FCALL                                      0  $5      
         14        SEND_VAR                                                 $5
         15        DO_ICALL                                                 
         16      > RETURN                                                   1

Function flatten_array:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XPiM6
function name:  flatten_array
number of ops:  10
compiled vars:  !0 = $array, !1 = $flattened_array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   RECV                                             !0      
   23     1        ASSIGN                                                   !1, <array>
   24     2        INIT_FCALL                                               'array_walk_recursive'
          3        SEND_REF                                                 !0
          4        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FXPiM6%3A24%240'
          5        BIND_LEXICAL                                             ~3, !1
          6        SEND_VAL                                                 ~3
          7        DO_ICALL                                                 
   25     8      > RETURN                                                   !1
   26     9*     > RETURN                                                   null

End of function flatten_array

Function %00%7Bclosure%7D%2Fin%2FXPiM6%3A24%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XPiM6
function name:  {closure}
number of ops:  5
compiled vars:  !0 = $a, !1 = $flattened_array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
          2        ASSIGN_DIM                                               !1
          3        OP_DATA                                                  !0
          4      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FXPiM6%3A24%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
190.65 ms | 1398 KiB | 18 Q