3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = array('one' => array( 'two' => 3, 'four' => array(5,6,7)),'eight' => array( 'nine'=> array('ten' =>11))); function aarray_to_vlue($akey,$val) { $array_key = array(); if(is_array($val)) { foreach($val as $key => $value) { if($akey != '') { $pkey = $akey.'/'.$key; } else { $pkey = $key; } if(is_array($value)) { $array_key = array_to_value($pkey,$value); } $array_key[$pkey] = $value; } return $array_key; } } print_r(aarray_to_vlue($data)); print_r($data);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/K6tWo
function name:  (null)
number of ops:  11
compiled vars:  !0 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
   23     1        INIT_FCALL                                               'print_r'
          2        INIT_FCALL                                               'aarray_to_vlue'
          3        SEND_VAR                                                 !0
          4        DO_FCALL                                      0  $2      
          5        SEND_VAR                                                 $2
          6        DO_ICALL                                                 
   24     7        INIT_FCALL                                               'print_r'
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                                 
         10      > RETURN                                                   1

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

End of function aarray_to_vlue

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.09 ms | 1403 KiB | 16 Q