3v4l.org

run code in 300+ PHP versions simultaneously
<?php $forecastedMonths = [ "May 22", "Jun 22", "Jul 22", "Aug 22", "Sep 22", "Oct 22", "Nov 22", "Dec 22", "Jan 23", "Feb 23", "Mar 23", "Apr 23" ]; $data = [ 1 => 0, 2 => 0, 3 => 0, 4 => 0, 5 => 172427.89, //May 6 => 0, 7 => 243730.79, //Jul 8 => 0, 9 => 0, 10 => 0, 11 => 0, 12 => 0, ]; $result = []; foreach ($forecastedMonths as $My) { $result[] = $data[date('n', strtotime($My))]; } var_export($result);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 16
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 16
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
filename:       /in/AXt0o
function name:  (null)
number of ops:  21
compiled vars:  !0 = $forecastedMonths, !1 = $data, !2 = $result, !3 = $My
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   18     1        ASSIGN                                                   !1, <array>
   33     2        ASSIGN                                                   !2, <array>
   34     3      > FE_RESET_R                                       $7      !0, ->16
          4    > > FE_FETCH_R                                               $7, !3, ->16
   35     5    >   INIT_FCALL                                               'date'
          6        SEND_VAL                                                 'n'
          7        INIT_FCALL                                               'strtotime'
          8        SEND_VAR                                                 !3
          9        DO_ICALL                                         $9      
         10        SEND_VAR                                                 $9
         11        DO_ICALL                                         $10     
         12        FETCH_DIM_R                                      ~11     !1, $10
         13        ASSIGN_DIM                                               !2
         14        OP_DATA                                                  ~11
   34    15      > JMP                                                      ->4
         16    >   FE_FREE                                                  $7
   37    17        INIT_FCALL                                               'var_export'
         18        SEND_VAR                                                 !2
         19        DO_ICALL                                                 
         20      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
132.1 ms | 999 KiB | 16 Q