3v4l.org

run code in 300+ PHP versions simultaneously
<?php function convertAssociativeArrayToValue( array $data ) { $result = []; foreach( $data as $key => $value ) { // if( is_array( $value ) ) { if( ! array_key_exists( 0, $value ) ) { $string = implode( ',', convertAssociativeArrayToValue( $value ) ); } else { $string = implode( ',', $values ); } $value = "[" . $string . "]"; } $result[] = "{$key}:{$value}"; } return $result; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/J8Hht
function name:  (null)
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E > > RETURN                                                   1

Function convertassociativearraytovalue:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 33
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 33
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 27
Branch analysis from position: 7
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 19
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 24
Branch analysis from position: 24
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 27
Branch analysis from position: 33
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 33
filename:       /in/J8Hht
function name:  convertAssociativeArrayToValue
number of ops:  36
compiled vars:  !0 = $data, !1 = $result, !2 = $value, !3 = $key, !4 = $string, !5 = $values
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    5     1        ASSIGN                                                   !1, <array>
    6     2      > FE_RESET_R                                       $7      !0, ->33
          3    > > FE_FETCH_R                                       ~8      $7, !2, ->33
          4    >   ASSIGN                                                   !3, ~8
    9     5        TYPE_CHECK                                  128          !2
          6      > JMPZ                                                     ~10, ->27
   11     7    >   ARRAY_KEY_EXISTS                                 ~11     0, !2
          8        BOOL_NOT                                         ~12     ~11
          9      > JMPZ                                                     ~12, ->19
   12    10    >   INIT_FCALL                                               'implode'
         11        SEND_VAL                                                 '%2C'
         12        INIT_FCALL_BY_NAME                                       'convertAssociativeArrayToValue'
         13        SEND_VAR_EX                                              !2
         14        DO_FCALL                                      0  $13     
         15        SEND_VAR                                                 $13
         16        DO_ICALL                                         $14     
         17        ASSIGN                                                   !4, $14
         18      > JMP                                                      ->24
   15    19    >   INIT_FCALL                                               'implode'
         20        SEND_VAL                                                 '%2C'
         21        SEND_VAR                                                 !5
         22        DO_ICALL                                         $16     
         23        ASSIGN                                                   !4, $16
   18    24    >   CONCAT                                           ~18     '%5B', !4
         25        CONCAT                                           ~19     ~18, '%5D'
         26        ASSIGN                                                   !2, ~19
   20    27    >   ROPE_INIT                                     3  ~23     !3
         28        ROPE_ADD                                      1  ~23     ~23, '%3A'
         29        ROPE_END                                      2  ~22     ~23, !2
         30        ASSIGN_DIM                                               !1
         31        OP_DATA                                                  ~22
    6    32      > JMP                                                      ->3
         33    >   FE_FREE                                                  $7
   23    34      > RETURN                                                   !1
   24    35*     > RETURN                                                   null

End of function convertassociativearraytovalue

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.55 ms | 1400 KiB | 15 Q