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 echo $constructedValue = implodeMultiArr($arrVal); function implodeMultiArr($arrVal) { foreach ( $arrVal as $key=>$value ) { if ( is_array($value) ) { $constructedValue .= "[".implodeMultiArr($value)."]"; } else { $constructedValue .= $value."||"; } } }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JaDr7
function name:  (null)
number of ops:  7
compiled vars:  !0 = $arrVal, !1 = $constructedValue
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
   24     1        INIT_FCALL_BY_NAME                                       'implodeMultiArr'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0  $3      
          4        ASSIGN                                           ~4      !1, $3
          5        ECHO                                                     ~4
   33     6      > 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/JaDr7
function name:  implodeMultiArr
number of ops:  18
compiled vars:  !0 = $arrVal, !1 = $value, !2 = $key, !3 = $constructedValue
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   RECV                                             !0      
   26     1      > FE_RESET_R                                       $4      !0, ->16
          2    > > FE_FETCH_R                                       ~5      $4, !1, ->16
          3    >   ASSIGN                                                   !2, ~5
   27     4        TYPE_CHECK                                  128          !1
          5      > JMPZ                                                     ~7, ->13
   28     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
   30    13    >   CONCAT                                           ~12     !1, '%7C%7C'
         14        ASSIGN_OP                                     8          !3, ~12
   26    15    > > JMP                                                      ->2
         16    >   FE_FREE                                                  $4
   33    17      > RETURN                                                   null

End of function implodemultiarr

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.4 ms | 1386 KiB | 13 Q