3v4l.org

run code in 300+ PHP versions simultaneously
<?php $end = new DateTime(); $start = new DateTime(); $hourStart = $start->format('H'); $minuteStart = $start->format('i') > 30 ? 30 : 0; $start = $start->setTime($hourStart, $minuteStart)->modify('-48 hours'); $dateInterval = new DateInterval('PT30M'); $datePeriod = new DatePeriod($start, $dateInterval, $end); $result = array(); foreach($datePeriod as $date) { $d1 = $date->format('m/d/y - H:i'); $result[] = $d1; // Your logic here } var_dump($result);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 17
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
2 jumps found. (Code = 77) Position 1 = 39, Position 2 = 47
Branch analysis from position: 39
2 jumps found. (Code = 78) Position 1 = 40, Position 2 = 47
Branch analysis from position: 40
1 jumps found. (Code = 42) Position 1 = 39
Branch analysis from position: 39
Branch analysis from position: 47
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 47
Branch analysis from position: 17
2 jumps found. (Code = 77) Position 1 = 39, Position 2 = 47
Branch analysis from position: 39
Branch analysis from position: 47
filename:       /in/amc0p
function name:  (null)
number of ops:  52
compiled vars:  !0 = $end, !1 = $start, !2 = $hourStart, !3 = $minuteStart, !4 = $dateInterval, !5 = $datePeriod, !6 = $result, !7 = $date, !8 = $d1
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $9      'DateTime'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $9
    4     3        NEW                                              $12     'DateTime'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !1, $12
    6     6        INIT_METHOD_CALL                                         !1, 'format'
          7        SEND_VAL_EX                                              'H'
          8        DO_FCALL                                      0  $15     
          9        ASSIGN                                                   !2, $15
    7    10        INIT_METHOD_CALL                                         !1, 'format'
         11        SEND_VAL_EX                                              'i'
         12        DO_FCALL                                      0  $17     
         13        IS_SMALLER                                               30, $17
         14      > JMPZ                                                     ~18, ->17
         15    >   QM_ASSIGN                                        ~19     30
         16      > JMP                                                      ->18
         17    >   QM_ASSIGN                                        ~19     0
         18    >   ASSIGN                                                   !3, ~19
    8    19        INIT_METHOD_CALL                                         !1, 'setTime'
         20        SEND_VAR_EX                                              !2
         21        SEND_VAR_EX                                              !3
         22        DO_FCALL                                      0  $21     
         23        INIT_METHOD_CALL                                         $21, 'modify'
         24        SEND_VAL_EX                                              '-48+hours'
         25        DO_FCALL                                      0  $22     
         26        ASSIGN                                                   !1, $22
    9    27        NEW                                              $24     'DateInterval'
         28        SEND_VAL_EX                                              'PT30M'
         29        DO_FCALL                                      0          
         30        ASSIGN                                                   !4, $24
   10    31        NEW                                              $27     'DatePeriod'
         32        SEND_VAR_EX                                              !1
         33        SEND_VAR_EX                                              !4
         34        SEND_VAR_EX                                              !0
         35        DO_FCALL                                      0          
         36        ASSIGN                                                   !5, $27
   12    37        ASSIGN                                                   !6, <array>
   13    38      > FE_RESET_R                                       $31     !5, ->47
         39    > > FE_FETCH_R                                               $31, !7, ->47
   14    40    >   INIT_METHOD_CALL                                         !7, 'format'
         41        SEND_VAL_EX                                              'm%2Fd%2Fy+-+H%3Ai'
         42        DO_FCALL                                      0  $32     
         43        ASSIGN                                                   !8, $32
   15    44        ASSIGN_DIM                                               !6
         45        OP_DATA                                                  !8
   13    46      > JMP                                                      ->39
         47    >   FE_FREE                                                  $31
   20    48        INIT_FCALL                                               'var_dump'
         49        SEND_VAR                                                 !6
         50        DO_ICALL                                                 
         51      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.87 ms | 1400 KiB | 15 Q