3v4l.org

run code in 500+ PHP versions simultaneously
<?php $data = [ [ "price_in_dollar" => 1000, "price_in_euro" => 1000, "price_in_pound" => 1000, "price_in_rupee" => 1000, "toy_id" => 1, "toy_name" => "Truck" ], [ "price_in_dollar" => 1000, "price_in_euro" => 1000, "price_in_pound" => 1000, "price_in_rupee" => 1000, "toy_id" => 2, "toy_name" => "Bicycle" ] ]; $result = []; foreach ($data as $row) { ['toy_id' => $id, 'toy_name' => $name] = $row; unset($row['toy_id'], $row['toy_name']); foreach ($row as $slug => $rate) { $result[] = compact(['id', 'name', 'slug', 'rate']); } } var_export($result);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 23
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 23
Branch analysis from position: 4
2 jumps found. (Code = 77) Position 1 = 13, Position 2 = 21
Branch analysis from position: 13
2 jumps found. (Code = 78) Position 1 = 14, Position 2 = 21
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 21
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 23
filename:       /in/I2LFs
function name:  (null)
number of ops:  28
compiled vars:  !0 = $data, !1 = $result, !2 = $row, !3 = $id, !4 = $name, !5 = $rate, !6 = $slug
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
   22     1        ASSIGN                                                       !1, <array>
   23     2      > FE_RESET_R                                           $9      !0, ->23
          3    > > FE_FETCH_R                                                   $9, !2, ->23
   24     4    >   QM_ASSIGN                                            ~10     !2
          5        FETCH_LIST_R                                         $11     ~10, 'toy_id'
          6        ASSIGN                                                       !3, $11
          7        FETCH_LIST_R                                         $13     ~10, 'toy_name'
          8        ASSIGN                                                       !4, $13
          9        FREE                                                         ~10
   25    10        UNSET_DIM                                                    !2, 'toy_id'
         11        UNSET_DIM                                                    !2, 'toy_name'
   26    12      > FE_RESET_R                                           $15     !2, ->21
         13    > > FE_FETCH_R                                           ~16     $15, !5, ->21
         14    >   ASSIGN                                                       !6, ~16
   27    15        INIT_FCALL                                                   'compact'
         16        SEND_VAL                                                     <array>
         17        DO_ICALL                                             $19     
         18        ASSIGN_DIM                                                   !1
         19        OP_DATA                                                      $19
   26    20      > JMP                                                          ->13
         21    >   FE_FREE                                                      $15
   23    22      > JMP                                                          ->3
         23    >   FE_FREE                                                      $9
   30    24        INIT_FCALL                                                   'var_export'
         25        SEND_VAR                                                     !1
         26        DO_ICALL                                                     
         27      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
166.56 ms | 2030 KiB | 15 Q