3v4l.org

run code in 500+ PHP versions simultaneously
<?php $items = array( array( 'forename' => 'Foo', 'surname' => 'Bar' ), array( 'forename' => 'Bar', 'surname' => 'Foo' ) ); $arr = array(); foreach($items as $item){ $arr['name'][] = $item['forename']; $arr['surname'][] = $item['surname']; } echo "<pre>".print_r($arr, true)."</pre>"; ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 13
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 13
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
filename:       /in/v2GhH
function name:  (null)
number of ops:  22
compiled vars:  !0 = $items, !1 = $arr, !2 = $item
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                       !0, <array>
   13     1        ASSIGN                                                       !1, <array>
   16     2      > FE_RESET_R                                           $5      !0, ->13
          3    > > FE_FETCH_R                                                   $5, !2, ->13
   17     4    >   FETCH_DIM_R                                          ~8      !2, 'forename'
          5        FETCH_DIM_W                                          $6      !1, 'name'
          6        ASSIGN_DIM                                                   $6
          7        OP_DATA                                                      ~8
   18     8        FETCH_DIM_R                                          ~11     !2, 'surname'
          9        FETCH_DIM_W                                          $9      !1, 'surname'
         10        ASSIGN_DIM                                                   $9
         11        OP_DATA                                                      ~11
   16    12      > JMP                                                          ->3
         13    >   FE_FREE                                                      $5
   22    14        INIT_FCALL                                                   'print_r'
         15        SEND_VAR                                                     !1
         16        SEND_VAL                                                     <true>
         17        DO_ICALL                                             $12     
         18        CONCAT                                               ~13     '%3Cpre%3E', $12
         19        CONCAT                                               ~14     ~13, '%3C%2Fpre%3E'
         20        ECHO                                                         ~14
   23    21      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
172.64 ms | 3117 KiB | 13 Q