3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data_array = array('root1' => array(1,2,3), 'root2' => array(3,4,5)); $out = ''; foreach ($data_array as $key => $value) { $out.= $key.'=>['; $count = count($value); foreach ($value as $val) { $out.=$val.','; } $out = rtrim($out, ",<br />,"); $out.= '],<br />'; } $out = rtrim($out,','); echo $out;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 22
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 22
Branch analysis from position: 4
2 jumps found. (Code = 77) Position 1 = 10, Position 2 = 14
Branch analysis from position: 10
2 jumps found. (Code = 78) Position 1 = 11, Position 2 = 14
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 14
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
filename:       /in/0jsKl
function name:  (null)
number of ops:  30
compiled vars:  !0 = $data_array, !1 = $out, !2 = $value, !3 = $key, !4 = $count, !5 = $val
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    4     1        ASSIGN                                                   !1, ''
    5     2      > FE_RESET_R                                       $8      !0, ->22
          3    > > FE_FETCH_R                                       ~9      $8, !2, ->22
          4    >   ASSIGN                                                   !3, ~9
    7     5        CONCAT                                           ~11     !3, '%3D%3E%5B'
          6        ASSIGN_OP                                     8          !1, ~11
    8     7        COUNT                                            ~13     !2
          8        ASSIGN                                                   !4, ~13
    9     9      > FE_RESET_R                                       $15     !2, ->14
         10    > > FE_FETCH_R                                               $15, !5, ->14
   10    11    >   CONCAT                                           ~16     !5, '%2C'
         12        ASSIGN_OP                                     8          !1, ~16
    9    13      > JMP                                                      ->10
         14    >   FE_FREE                                                  $15
   12    15        INIT_FCALL                                               'rtrim'
         16        SEND_VAR                                                 !1
         17        SEND_VAL                                                 '%2C%3Cbr+%2F%3E%2C'
         18        DO_ICALL                                         $18     
         19        ASSIGN                                                   !1, $18
   13    20        ASSIGN_OP                                     8          !1, '%5D%2C%3Cbr+%2F%3E'
    5    21      > JMP                                                      ->3
         22    >   FE_FREE                                                  $8
   15    23        INIT_FCALL                                               'rtrim'
         24        SEND_VAR                                                 !1
         25        SEND_VAL                                                 '%2C'
         26        DO_ICALL                                         $21     
         27        ASSIGN                                                   !1, $21
   16    28        ECHO                                                     !1
         29      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.63 ms | 1396 KiB | 15 Q