3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [['range' => 336, 'year' => 2020],['range' => 336, 'year' => 2020],['range' => 390, 'year' => 2020],['range' => 390, 'year' => 2021]]; $idList = array_flip(array_values(array_unique(array_column($array, 'range')))); $newDatesCurrent = []; foreach($array as $value) { $newDatesCurrent[] = ['range' => $idList[$value['range']], 'year' => $value['year'], 'month' => 222]; } print_r($newDatesCurrent);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 17, Position 2 = 27
Branch analysis from position: 17
2 jumps found. (Code = 78) Position 1 = 18, Position 2 = 27
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
Branch analysis from position: 27
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 27
filename:       /in/kUa8D
function name:  (null)
number of ops:  32
compiled vars:  !0 = $array, !1 = $idList, !2 = $newDatesCurrent, !3 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        INIT_FCALL                                               'array_flip'
          2        INIT_FCALL                                               'array_values'
          3        INIT_FCALL                                               'array_unique'
          4        INIT_FCALL                                               'array_column'
          5        SEND_VAR                                                 !0
          6        SEND_VAL                                                 'range'
          7        DO_ICALL                                         $5      
          8        SEND_VAR                                                 $5
          9        DO_ICALL                                         $6      
         10        SEND_VAR                                                 $6
         11        DO_ICALL                                         $7      
         12        SEND_VAR                                                 $7
         13        DO_ICALL                                         $8      
         14        ASSIGN                                                   !1, $8
    5    15        ASSIGN                                                   !2, <array>
    6    16      > FE_RESET_R                                       $11     !0, ->27
         17    > > FE_FETCH_R                                               $11, !3, ->27
    7    18    >   FETCH_DIM_R                                      ~13     !3, 'range'
         19        FETCH_DIM_R                                      ~14     !1, ~13
         20        INIT_ARRAY                                       ~15     ~14, 'range'
         21        FETCH_DIM_R                                      ~16     !3, 'year'
         22        ADD_ARRAY_ELEMENT                                ~15     ~16, 'year'
         23        ADD_ARRAY_ELEMENT                                ~15     222, 'month'
         24        ASSIGN_DIM                                               !2
         25        OP_DATA                                                  ~15
    6    26      > JMP                                                      ->17
         27    >   FE_FREE                                                  $11
   10    28        INIT_FCALL                                               'print_r'
         29        SEND_VAR                                                 !2
         30        DO_ICALL                                                 
         31      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.15 ms | 1400 KiB | 23 Q