3v4l.org

run code in 300+ PHP versions simultaneously
<?php $avaDates = [ ['date_starts' => '2024-03-01'], ['date_starts' => '2024-03-09'], ['date_starts' => '2024-04-05'], ['date_starts' => '2024-04-09'], ['date_starts' => '2024-04-15'], ['date_starts' => '2024-05-03'] ]; $result = []; foreach ($avaDates as ['date_starts' => $d]) { $FY = date("F-Y", strtotime($d)); $result[$FY] = ($result[$FY] ?? 0) + 1; } foreach ($result as $fy => $count) { echo strtolower("$fy $count\n"); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 22
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 22
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 22
2 jumps found. (Code = 77) Position 1 = 24, Position 2 = 35
Branch analysis from position: 24
2 jumps found. (Code = 78) Position 1 = 25, Position 2 = 35
Branch analysis from position: 25
1 jumps found. (Code = 42) Position 1 = 24
Branch analysis from position: 24
Branch analysis from position: 35
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 35
Branch analysis from position: 22
filename:       /in/FLULp
function name:  (null)
number of ops:  37
compiled vars:  !0 = $avaDates, !1 = $result, !2 = $d, !3 = $FY, !4 = $count, !5 = $fy
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   12     1        ASSIGN                                                   !1, <array>
   13     2      > FE_RESET_R                                       $8      !0, ->22
          3    > > FE_FETCH_R                                               $8, $9, ->22
          4    >   FETCH_LIST_R                                     $10     $9, 'date_starts'
          5        ASSIGN                                                   !2, $10
          6        FREE                                                     $9
   14     7        INIT_FCALL                                               'date'
          8        SEND_VAL                                                 'F-Y'
          9        INIT_FCALL                                               'strtotime'
         10        SEND_VAR                                                 !2
         11        DO_ICALL                                         $12     
         12        SEND_VAR                                                 $12
         13        DO_ICALL                                         $13     
         14        ASSIGN                                                   !3, $13
   15    15        FETCH_DIM_IS                                     ~16     !1, !3
         16        COALESCE                                         ~17     ~16
         17        QM_ASSIGN                                        ~17     0
         18        ADD                                              ~18     ~17, 1
         19        ASSIGN_DIM                                               !1, !3
         20        OP_DATA                                                  ~18
   13    21      > JMP                                                      ->3
         22    >   FE_FREE                                                  $8
   17    23      > FE_RESET_R                                       $19     !1, ->35
         24    > > FE_FETCH_R                                       ~20     $19, !4, ->35
         25    >   ASSIGN                                                   !5, ~20
   18    26        INIT_FCALL                                               'strtolower'
         27        ROPE_INIT                                     4  ~23     !5
         28        ROPE_ADD                                      1  ~23     ~23, '+'
         29        ROPE_ADD                                      2  ~23     ~23, !4
         30        ROPE_END                                      3  ~22     ~23, '%0A'
         31        SEND_VAL                                                 ~22
         32        DO_ICALL                                         $25     
         33        ECHO                                                     $25
   17    34      > JMP                                                      ->24
         35    >   FE_FREE                                                  $19
   19    36      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
137.02 ms | 1005 KiB | 16 Q