3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.29 ms | 1396 KiB | 15 Q