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 array_to_value($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); }else { $array_key[$pkey] = $value; } } return $array_key; } } print_r(array_to_value('',$data)); print_r($data);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/F7Co6
function name:  (null)
number of ops:  12
compiled vars:  !0 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
   24     1        INIT_FCALL                                               'print_r'
          2        INIT_FCALL                                               'array_to_value'
          3        SEND_VAL                                                 ''
          4        SEND_VAR                                                 !0
          5        DO_FCALL                                      0  $2      
          6        SEND_VAR                                                 $2
          7        DO_ICALL                                                 
   25     8        INIT_FCALL                                               'print_r'
          9        SEND_VAR                                                 !0
         10        DO_ICALL                                                 
         11      > RETURN                                                   1

Function array_to_value:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 29
Branch analysis from position: 5
2 jumps found. (Code = 77) Position 1 = 6, Position 2 = 27
Branch analysis from position: 6
2 jumps found. (Code = 78) Position 1 = 7, Position 2 = 27
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 = 24
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 26
Branch analysis from position: 26
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
Branch analysis from position: 24
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
Branch analysis from position: 14
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 24
Branch analysis from position: 17
Branch analysis from position: 24
Branch analysis from position: 27
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 27
Branch analysis from position: 29
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/F7Co6
function name:  array_to_value
number of ops:  30
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, ->29
    7     5    > > FE_RESET_R                                       $8      !1, ->27
          6    > > FE_FETCH_R                                       ~9      $8, !3, ->27
          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, ->24
   14    17    >   INIT_FCALL_BY_NAME                                       'array_to_value'
         18        SEND_VAR_EX                                              !5
         19        SEND_VAR_EX                                              !3
         20        DO_FCALL                                      0  $18     
         21        ASSIGN_DIM                                               !2
         22        OP_DATA                                                  $18
         23      > JMP                                                      ->26
   16    24    >   ASSIGN_DIM                                               !2, !5
         25        OP_DATA                                                  !3
    7    26    > > JMP                                                      ->6
         27    >   FE_FREE                                                  $8
   20    28      > RETURN                                                   !2
   23    29    > > RETURN                                                   null

End of function array_to_value

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
174.44 ms | 1402 KiB | 16 Q