3v4l.org

run code in 500+ PHP versions simultaneously
<?php $d = [ [ 'type' => 25500, 'month' => 'July' ], [ 'type' => 5465, 'month' => 'January' ], [ 'type' => 40000, 'month' => 'April' ], [ 'type' => 35000, 'month' => 'June' ], [ 'type' => 10000, 'month' => 'February' ] ]; $allMonths = ['January','February','March', 'April','May','June','July','August','September','October','November','December']; $currentMonths = array_column($d, 'month'); $notIncludedMonth = array_diff($allMonths,$currentMonths); foreach ($notIncludedMonth as $month) { $d[] = [ 'type' => 0, 'month' => $month, ]; } print_r($d);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 13, Position 2 = 19
Branch analysis from position: 13
2 jumps found. (Code = 78) Position 1 = 14, Position 2 = 19
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
filename:       /in/GsFoO
function name:  (null)
number of ops:  24
compiled vars:  !0 = $d, !1 = $allMonths, !2 = $currentMonths, !3 = $notIncludedMonth, !4 = $month
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
   26     1        ASSIGN                                                       !1, <array>
   28     2        INIT_FCALL                                                   'array_column'
          3        SEND_VAR                                                     !0
          4        SEND_VAL                                                     'month'
          5        DO_ICALL                                             $7      
          6        ASSIGN                                                       !2, $7
   30     7        INIT_FCALL                                                   'array_diff'
          8        SEND_VAR                                                     !1
          9        SEND_VAR                                                     !2
         10        DO_ICALL                                             $9      
         11        ASSIGN                                                       !3, $9
   32    12      > FE_RESET_R                                           $11     !3, ->19
         13    > > FE_FETCH_R                                                   $11, !4, ->19
   34    14    >   INIT_ARRAY                                           ~13     0, 'type'
   35    15        ADD_ARRAY_ELEMENT                                    ~13     !4, 'month'
   33    16        ASSIGN_DIM                                                   !0
   35    17        OP_DATA                                                      ~13
   32    18      > JMP                                                          ->13
         19    >   FE_FREE                                                      $11
   39    20        INIT_FCALL                                                   'print_r'
         21        SEND_VAR                                                     !0
         22        DO_ICALL                                                     
         23      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
162.91 ms | 2258 KiB | 16 Q