3v4l.org

run code in 300+ PHP versions simultaneously
<?php $attributes = array( 'Users' => array( 'Name' => 'Name', ), 'Address' => 'Address', 'Tags' => array( 0 => array( 'Key' => 'Key', 'Value' => 'Value', ), 1 => array( 'Key' => 'Key', ), 2 => array( ) ), ); function deal($array, $prekey){ $res = array(); foreach ($array as $key => $val) { if(is_array($val)){ $tmp = deal($val, $prekey.$key."_"); $res = array_merge($tmp, $res); }else{ $res[$prekey.$key] = $val; } } return $res; } print_r(deal($attributes, ''));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sSk9K
function name:  (null)
number of ops:  9
compiled vars:  !0 = $attributes
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   33     1        INIT_FCALL                                               'print_r'
          2        INIT_FCALL                                               'deal'
          3        SEND_VAR                                                 !0
          4        SEND_VAL                                                 ''
          5        DO_FCALL                                      0  $2      
          6        SEND_VAR                                                 $2
          7        DO_ICALL                                                 
          8      > RETURN                                                   1

Function deal:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 25
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 25
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 21
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 24
Branch analysis from position: 24
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 25
filename:       /in/sSk9K
function name:  deal
number of ops:  28
compiled vars:  !0 = $array, !1 = $prekey, !2 = $res, !3 = $val, !4 = $key, !5 = $tmp
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   22     2        ASSIGN                                                   !2, <array>
   23     3      > FE_RESET_R                                       $7      !0, ->25
          4    > > FE_FETCH_R                                       ~8      $7, !3, ->25
          5    >   ASSIGN                                                   !4, ~8
   24     6        TYPE_CHECK                                  128          !3
          7      > JMPZ                                                     ~10, ->21
   25     8    >   INIT_FCALL_BY_NAME                                       'deal'
          9        SEND_VAR_EX                                              !3
         10        CONCAT                                           ~11     !1, !4
         11        CONCAT                                           ~12     ~11, '_'
         12        SEND_VAL_EX                                              ~12
         13        DO_FCALL                                      0  $13     
         14        ASSIGN                                                   !5, $13
   26    15        INIT_FCALL                                               'array_merge'
         16        SEND_VAR                                                 !5
         17        SEND_VAR                                                 !2
         18        DO_ICALL                                         $15     
         19        ASSIGN                                                   !2, $15
         20      > JMP                                                      ->24
   28    21    >   CONCAT                                           ~17     !1, !4
         22        ASSIGN_DIM                                               !2, ~17
         23        OP_DATA                                                  !3
   23    24    > > JMP                                                      ->4
         25    >   FE_FREE                                                  $7
   31    26      > RETURN                                                   !2
   32    27*     > RETURN                                                   null

End of function deal

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
194.63 ms | 1403 KiB | 18 Q