3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ ['month' => 'June', 'sale' => 98765], ['month' => 'May', 'sale' => 45678], ['month' => 'April', 'sale' => 213456], ['month' => 'August', 'sale' => 23456], ['month' => 'July', 'sale' => 12376], ]; $months = []; $sales = []; foreach ($array as ['month' => $months[], 'sale' => $sales[]]); echo json_encode($months); echo "\n---\n"; echo json_encode($sales);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 13
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 13
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
filename:       /in/jOP7u
function name:  (null)
number of ops:  24
compiled vars:  !0 = $array, !1 = $months, !2 = $sales
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   11     1        ASSIGN                                                   !1, <array>
   12     2        ASSIGN                                                   !2, <array>
   13     3      > FE_RESET_R                                       $6      !0, ->13
          4    > > FE_FETCH_R                                               $6, $7, ->13
          5    >   FETCH_LIST_R                                     $8      $7, 'month'
          6        ASSIGN_DIM                                               !1
          7        OP_DATA                                                  $8
          8        FETCH_LIST_R                                     $10     $7, 'sale'
          9        ASSIGN_DIM                                               !2
         10        OP_DATA                                                  $10
         11        FREE                                                     $7
         12      > JMP                                                      ->4
         13    >   FE_FREE                                                  $6
   14    14        INIT_FCALL                                               'json_encode'
         15        SEND_VAR                                                 !1
         16        DO_ICALL                                         $12     
         17        ECHO                                                     $12
   15    18        ECHO                                                     '%0A---%0A'
   16    19        INIT_FCALL                                               'json_encode'
         20        SEND_VAR                                                 !2
         21        DO_ICALL                                         $13     
         22        ECHO                                                     $13
         23      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
174.39 ms | 1002 KiB | 14 Q