3v4l.org

run code in 300+ PHP versions simultaneously
<?php $dates = [ '03-08-15 12:07:16 PM', '03-08-15 01:54:16 PM', '03-08-15 02:18:35 PM', '03-08-15 06:32:17 PM', '04-08-15 11:40:25 AM', '04-08-15 01:47:23 PM', '04-08-15 02:13:31 PM', '04-08-15 05:46:10 PM', '05-08-15 11:36:20 AM', '05-08-15 01:43:04 PM', '05-08-15 02:25:14 PM', '05-08-15 06:06:24 PM', '06-08-15 11:25:31 AM', '06-08-15 01:52:32 PM', ]; $newDates = []; foreach ($dates as $date) { $dataTime = DateTime::createFromFormat('d-m-y H:i:s A', $date); $newDates[$dataTime->format('d-m-y')][$dataTime->format('h')] = $dataTime->format('h:i:s A'); } var_dump($newDates);
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
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
filename:       /in/8X8Wg
function name:  (null)
number of ops:  27
compiled vars:  !0 = $dates, !1 = $newDates, !2 = $date, !3 = $dataTime
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   20     1        ASSIGN                                                   !1, <array>
   21     2      > FE_RESET_R                                       $6      !0, ->22
          3    > > FE_FETCH_R                                               $6, !2, ->22
   22     4    >   INIT_STATIC_METHOD_CALL                                  'DateTime', 'createFromFormat'
          5        SEND_VAL                                                 'd-m-y+H%3Ai%3As+A'
          6        SEND_VAR                                                 !2
          7        DO_FCALL                                      0  $7      
          8        ASSIGN                                                   !3, $7
   23     9        INIT_METHOD_CALL                                         !3, 'format'
         10        SEND_VAL_EX                                              'd-m-y'
         11        DO_FCALL                                      0  $9      
         12        INIT_METHOD_CALL                                         !3, 'format'
         13        SEND_VAL_EX                                              'h'
         14        DO_FCALL                                      0  $11     
         15        INIT_METHOD_CALL                                         !3, 'format'
         16        SEND_VAL_EX                                              'h%3Ai%3As+A'
         17        DO_FCALL                                      0  $13     
         18        FETCH_DIM_W                                      $10     !1, $9
         19        ASSIGN_DIM                                               $10, $11
         20        OP_DATA                                                  $13
   21    21      > JMP                                                      ->3
         22    >   FE_FREE                                                  $6
   26    23        INIT_FCALL                                               'var_dump'
         24        SEND_VAR                                                 !1
         25        DO_ICALL                                                 
         26      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.47 ms | 1395 KiB | 15 Q