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) { $iter++; $out.= $key.'=>['; $count = count($value); foreach ($value as $val) { $out.=$val.','; } $out = rtrim($out, ",<br />,"); $out.= ']'; if ($iter < ($count-1)) { $out.=',<br />'; } } echo $out;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 6, Position 2 = 30
Branch analysis from position: 6
2 jumps found. (Code = 78) Position 1 = 7, Position 2 = 30
Branch analysis from position: 7
2 jumps found. (Code = 77) Position 1 = 14, Position 2 = 18
Branch analysis from position: 14
2 jumps found. (Code = 78) Position 1 = 15, Position 2 = 18
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
Branch analysis from position: 18
2 jumps found. (Code = 43) Position 1 = 28, Position 2 = 29
Branch analysis from position: 28
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
Branch analysis from position: 29
Branch analysis from position: 18
Branch analysis from position: 30
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 30
filename:       /in/Q4n6n
function name:  (null)
number of ops:  33
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, ->30
          6    > > FE_FETCH_R                                       ~13     $12, !4, ->30
          7    >   ASSIGN                                                   !5, ~13
    9     8        PRE_INC                                                  !3
   10     9        CONCAT                                           ~16     !5, '%3D%3E%5B'
         10        ASSIGN_OP                                     8          !1, ~16
   11    11        COUNT                                            ~18     !4
         12        ASSIGN                                                   !2, ~18
   12    13      > FE_RESET_R                                       $20     !4, ->18
         14    > > FE_FETCH_R                                               $20, !6, ->18
   13    15    >   CONCAT                                           ~21     !6, '%2C'
         16        ASSIGN_OP                                     8          !1, ~21
   12    17      > JMP                                                      ->14
         18    >   FE_FREE                                                  $20
   15    19        INIT_FCALL                                               'rtrim'
         20        SEND_VAR                                                 !1
         21        SEND_VAL                                                 '%2C%3Cbr+%2F%3E%2C'
         22        DO_ICALL                                         $23     
         23        ASSIGN                                                   !1, $23
   16    24        ASSIGN_OP                                     8          !1, '%5D'
   17    25        SUB                                              ~26     !2, 1
         26        IS_SMALLER                                               !3, ~26
         27      > JMPZ                                                     ~27, ->29
   18    28    >   ASSIGN_OP                                     8          !1, '%2C%3Cbr+%2F%3E'
    7    29    > > JMP                                                      ->6
         30    >   FE_FREE                                                  $12
   23    31        ECHO                                                     !1
         32      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
141.53 ms | 1388 KiB | 15 Q