3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arrVal = array ( '22' => array( '0' => 60, '29' => array( '0' => 6 ), '30' => array ( '0' => 5, '1' => 8 ), '31' => array ( '0' => 7, '1' => 9, '2' => 14, '3' => 26 ) ), '23' => 12, '35' => 10, '42' => 22 ); //60[6][5||8][7||9||14||26]|12|10|22 $constructedValue = ""; echo $constructedValue = implodeMultiArr($arrVal); function implodeMultiArr($arrVal) { foreach ( $arrVal as $k=>$v) { if ( is_array($v) ) { $constructedValue .= "[".implodeMultiArr($v)."]"; } else { $constructedValue .= $v."||"; } } return $constructedValue; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BepZX
function name:  (null)
number of ops:  8
compiled vars:  !0 = $arrVal, !1 = $constructedValue
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
   24     1        ASSIGN                                                   !1, ''
   25     2        INIT_FCALL_BY_NAME                                       'implodeMultiArr'
          3        SEND_VAR_EX                                              !0
          4        DO_FCALL                                      0  $4      
          5        ASSIGN                                           ~5      !1, $4
          6        ECHO                                                     ~5
   35     7      > RETURN                                                   1

Function implodemultiarr:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 16
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 16
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 13
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
filename:       /in/BepZX
function name:  implodeMultiArr
number of ops:  19
compiled vars:  !0 = $arrVal, !1 = $v, !2 = $k, !3 = $constructedValue
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   26     0  E >   RECV                                             !0      
   27     1      > FE_RESET_R                                       $4      !0, ->16
          2    > > FE_FETCH_R                                       ~5      $4, !1, ->16
          3    >   ASSIGN                                                   !2, ~5
   28     4        TYPE_CHECK                                  128          !1
          5      > JMPZ                                                     ~7, ->13
   29     6    >   INIT_FCALL_BY_NAME                                       'implodeMultiArr'
          7        SEND_VAR_EX                                              !1
          8        DO_FCALL                                      0  $8      
          9        CONCAT                                           ~9      '%5B', $8
         10        CONCAT                                           ~10     ~9, '%5D'
         11        ASSIGN_OP                                     8          !3, ~10
         12      > JMP                                                      ->15
   31    13    >   CONCAT                                           ~12     !1, '%7C%7C'
         14        ASSIGN_OP                                     8          !3, ~12
   27    15    > > JMP                                                      ->2
         16    >   FE_FREE                                                  $4
   34    17      > RETURN                                                   !3
   35    18*     > RETURN                                                   null

End of function implodemultiarr

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.19 ms | 1386 KiB | 13 Q