3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = array('protein' => 'proteiny', 'total_fat' => 'total faty', 'carbohydrates' => 'carbohydrates', 'food_energy' => 'food energy'); $b = array('protein' => 'grams', 'total_fat' => 'grams', 'carbohydrates' => 'grams', 'food_energy' => 'kcals'); foreach($a as $k => $e) { $res[] = array('slug' => $k, 'name' => $e, 'format' => $b[$k]); } print_r($res);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 12
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 12
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
filename:       /in/QUkfJ
function name:  (null)
number of ops:  17
compiled vars:  !0 = $a, !1 = $b, !2 = $e, !3 = $k, !4 = $res
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, <array>
    7     1        ASSIGN                                                   !1, <array>
   10     2      > FE_RESET_R                                       $7      !0, ->12
          3    > > FE_FETCH_R                                       ~8      $7, !2, ->12
          4    >   ASSIGN                                                   !3, ~8
   11     5        INIT_ARRAY                                       ~11     !3, 'slug'
          6        ADD_ARRAY_ELEMENT                                ~11     !2, 'name'
          7        FETCH_DIM_R                                      ~12     !1, !3
          8        ADD_ARRAY_ELEMENT                                ~11     ~12, 'format'
          9        ASSIGN_DIM                                               !4
         10        OP_DATA                                                  ~11
   10    11      > JMP                                                      ->3
         12    >   FE_FREE                                                  $7
   14    13        INIT_FCALL                                               'print_r'
         14        SEND_VAR                                                 !4
         15        DO_ICALL                                                 
         16      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145.45 ms | 1010 KiB | 14 Q