3v4l.org

run code in 300+ PHP versions simultaneously
<?php $dates = ['20240228', '20240229', '20240301']; $groups = []; foreach ($dates as $date) { $date = new DateTime($date); $groups[$date->format('F')][] = $date->format('j'); } echo implode( ' & ', array_map( fn($j, $F) => implode(', ', $j) . " $F", $groups, array_keys($groups) ) );
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 18
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 18
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
filename:       /in/Jhnut
function name:  (null)
number of ops:  34
compiled vars:  !0 = $dates, !1 = $groups, !2 = $date
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    5     1        ASSIGN                                                   !1, <array>
    6     2      > FE_RESET_R                                       $5      !0, ->18
          3    > > FE_FETCH_R                                               $5, !2, ->18
    7     4    >   NEW                                              $6      'DateTime'
          5        SEND_VAR_EX                                              !2
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !2, $6
    8     8        INIT_METHOD_CALL                                         !2, 'format'
          9        SEND_VAL_EX                                              'F'
         10        DO_FCALL                                      0  $9      
         11        INIT_METHOD_CALL                                         !2, 'format'
         12        SEND_VAL_EX                                              'j'
         13        DO_FCALL                                      0  $12     
         14        FETCH_DIM_W                                      $10     !1, $9
         15        ASSIGN_DIM                                               $10
         16        OP_DATA                                                  $12
    6    17      > JMP                                                      ->3
         18    >   FE_FREE                                                  $5
   11    19        INIT_FCALL                                               'implode'
   12    20        SEND_VAL                                                 '+%26+'
   13    21        INIT_FCALL                                               'array_map'
   14    22        DECLARE_LAMBDA_FUNCTION                          ~13     [0]
         23        SEND_VAL                                                 ~13
   15    24        SEND_VAR                                                 !1
   16    25        INIT_FCALL                                               'array_keys'
         26        SEND_VAR                                                 !1
         27        DO_ICALL                                         $14     
         28        SEND_VAR                                                 $14
   13    29        DO_ICALL                                         $15     
   16    30        SEND_VAR                                                 $15
   11    31        DO_ICALL                                         $16     
   16    32        ECHO                                                     $16
   18    33      > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Jhnut
function name:  {closure}
number of ops:  11
compiled vars:  !0 = $j, !1 = $F
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        INIT_FCALL                                               'implode'
          3        SEND_VAL                                                 '%2C+'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $2      
          6        NOP                                                      
          7        FAST_CONCAT                                      ~3      '+', !1
          8        CONCAT                                           ~4      $2, ~3
          9      > RETURN                                                   ~4
         10*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
137.15 ms | 1433 KiB | 16 Q