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); foreach($datePeriod as $date) { $d1 = $date->format('m/d/y - H:i'); echo "$d1<br>"; // Your logic here }
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 = 38, Position 2 = 47
Branch analysis from position: 38
2 jumps found. (Code = 78) Position 1 = 39, Position 2 = 47
Branch analysis from position: 39
1 jumps found. (Code = 42) Position 1 = 38
Branch analysis from position: 38
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 = 38, Position 2 = 47
Branch analysis from position: 38
Branch analysis from position: 47
filename:       /in/8GXFa
function name:  (null)
number of ops:  49
compiled vars:  !0 = $end, !1 = $start, !2 = $hourStart, !3 = $minuteStart, !4 = $dateInterval, !5 = $datePeriod, !6 = $date, !7 = $d1
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $8      'DateTime'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $8
    4     3        NEW                                              $11     'DateTime'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !1, $11
    6     6        INIT_METHOD_CALL                                         !1, 'format'
          7        SEND_VAL_EX                                              'H'
          8        DO_FCALL                                      0  $14     
          9        ASSIGN                                                   !2, $14
    7    10        INIT_METHOD_CALL                                         !1, 'format'
         11        SEND_VAL_EX                                              'i'
         12        DO_FCALL                                      0  $16     
         13        IS_SMALLER                                               30, $16
         14      > JMPZ                                                     ~17, ->17
         15    >   QM_ASSIGN                                        ~18     30
         16      > JMP                                                      ->18
         17    >   QM_ASSIGN                                        ~18     0
         18    >   ASSIGN                                                   !3, ~18
    8    19        INIT_METHOD_CALL                                         !1, 'setTime'
         20        SEND_VAR_EX                                              !2
         21        SEND_VAR_EX                                              !3
         22        DO_FCALL                                      0  $20     
         23        INIT_METHOD_CALL                                         $20, 'modify'
         24        SEND_VAL_EX                                              '-48+hours'
         25        DO_FCALL                                      0  $21     
         26        ASSIGN                                                   !1, $21
    9    27        NEW                                              $23     'DateInterval'
         28        SEND_VAL_EX                                              'PT30M'
         29        DO_FCALL                                      0          
         30        ASSIGN                                                   !4, $23
   10    31        NEW                                              $26     'DatePeriod'
         32        SEND_VAR_EX                                              !1
         33        SEND_VAR_EX                                              !4
         34        SEND_VAR_EX                                              !0
         35        DO_FCALL                                      0          
         36        ASSIGN                                                   !5, $26
   13    37      > FE_RESET_R                                       $29     !5, ->47
         38    > > FE_FETCH_R                                               $29, !6, ->47
   14    39    >   INIT_METHOD_CALL                                         !6, 'format'
         40        SEND_VAL_EX                                              'm%2Fd%2Fy+-+H%3Ai'
         41        DO_FCALL                                      0  $30     
         42        ASSIGN                                                   !7, $30
   15    43        NOP                                                      
         44        FAST_CONCAT                                      ~32     !7, '%3Cbr%3E'
         45        ECHO                                                     ~32
   13    46      > JMP                                                      ->38
         47    >   FE_FREE                                                  $29
   18    48      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.1 ms | 1399 KiB | 13 Q