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); 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 = 5, Position 2 = 24
Branch analysis from position: 5
2 jumps found. (Code = 78) Position 1 = 6, Position 2 = 24
Branch analysis from position: 6
2 jumps found. (Code = 77) Position 1 = 12, Position 2 = 16
Branch analysis from position: 12
2 jumps found. (Code = 78) Position 1 = 13, Position 2 = 16
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
Branch analysis from position: 16
Branch analysis from position: 24
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 24
filename:       /in/NXsqu
function name:  (null)
number of ops:  32
compiled vars:  !0 = $data_array, !1 = $out, !2 = $count, !3 = $value, !4 = $key, !5 = $val
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    4     1        ASSIGN                                                   !1, ''
    5     2        COUNT                                            ~8      !0
          3        ASSIGN                                                   !2, ~8
    6     4      > FE_RESET_R                                       $10     !0, ->24
          5    > > FE_FETCH_R                                       ~11     $10, !3, ->24
          6    >   ASSIGN                                                   !4, ~11
    8     7        CONCAT                                           ~13     !4, '%3D%3E%5B'
          8        ASSIGN_OP                                     8          !1, ~13
    9     9        COUNT                                            ~15     !3
         10        ASSIGN                                                   !2, ~15
   10    11      > FE_RESET_R                                       $17     !3, ->16
         12    > > FE_FETCH_R                                               $17, !5, ->16
   11    13    >   CONCAT                                           ~18     !5, '%2C'
         14        ASSIGN_OP                                     8          !1, ~18
   10    15      > JMP                                                      ->12
         16    >   FE_FREE                                                  $17
   13    17        INIT_FCALL                                               'rtrim'
         18        SEND_VAR                                                 !1
         19        SEND_VAL                                                 '%2C%3Cbr+%2F%3E%2C'
         20        DO_ICALL                                         $20     
         21        ASSIGN                                                   !1, $20
   14    22        ASSIGN_OP                                     8          !1, '%5D%2C%3Cbr+%2F%3E'
    6    23      > JMP                                                      ->5
         24    >   FE_FREE                                                  $10
   16    25        INIT_FCALL                                               'rtrim'
         26        SEND_VAR                                                 !1
         27        SEND_VAL                                                 '%2C'
         28        DO_ICALL                                         $23     
         29        ASSIGN                                                   !1, $23
   17    30        ECHO                                                     !1
         31      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.17 ms | 1396 KiB | 15 Q