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)) { print_r($pkey); $array_key = array_to_value($pkey,$value); } $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/ARJeS
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 = 30
Branch analysis from position: 5
2 jumps found. (Code = 77) Position 1 = 6, Position 2 = 28
Branch analysis from position: 6
2 jumps found. (Code = 78) Position 1 = 7, Position 2 = 28
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 = 25
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
Branch analysis from position: 25
Branch analysis from position: 14
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 25
Branch analysis from position: 17
Branch analysis from position: 25
Branch analysis from position: 28
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 28
Branch analysis from position: 30
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ARJeS
function name:  array_to_value
number of ops:  31
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, ->30
    7     5    > > FE_RESET_R                                       $8      !1, ->28
          6    > > FE_FETCH_R                                       ~9      $8, !3, ->28
          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, ->25
   14    17    >   INIT_FCALL                                               'print_r'
         18        SEND_VAR                                                 !5
         19        DO_ICALL                                                 
   15    20        INIT_FCALL_BY_NAME                                       'array_to_value'
         21        SEND_VAR_EX                                              !5
         22        SEND_VAR_EX                                              !3
         23        DO_FCALL                                      0  $18     
         24        ASSIGN                                                   !2, $18
   17    25    >   ASSIGN_DIM                                               !2, !5
         26        OP_DATA                                                  !3
    7    27      > JMP                                                      ->6
         28    >   FE_FREE                                                  $8
   20    29      > RETURN                                                   !2
   23    30    > > RETURN                                                   null

End of function array_to_value

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.74 ms | 1403 KiB | 16 Q