3v4l.org

run code in 300+ PHP versions simultaneously
<?php $begin = new DateTime('2020-05-28 13:00'); $end = new DateTime('2020-05-28 15:30'); $timeRanges = []; while($begin < $end) { $output = $begin->format('H:i') . " - "; $begin->modify('+15 minutes'); /** Note, it modifies time by 15 minutes */ $output .= $begin->format('H:i'); $timeRanges[] = $output; } print_r($timeRanges);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 24
Branch analysis from position: 24
2 jumps found. (Code = 44) Position 1 = 26, Position 2 = 10
Branch analysis from position: 26
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
2 jumps found. (Code = 44) Position 1 = 26, Position 2 = 10
Branch analysis from position: 26
Branch analysis from position: 10
filename:       /in/r0E3R
function name:  (null)
number of ops:  30
compiled vars:  !0 = $begin, !1 = $end, !2 = $timeRanges, !3 = $output
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $4      'DateTime'
          1        SEND_VAL_EX                                              '2020-05-28+13%3A00'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $4
    4     4        NEW                                              $7      'DateTime'
          5        SEND_VAL_EX                                              '2020-05-28+15%3A30'
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !1, $7
    6     8        ASSIGN                                                   !2, <array>
    7     9      > JMP                                                      ->24
    9    10    >   INIT_METHOD_CALL                                         !0, 'format'
         11        SEND_VAL_EX                                              'H%3Ai'
         12        DO_FCALL                                      0  $11     
         13        CONCAT                                           ~12     $11, '+-+'
         14        ASSIGN                                                   !3, ~12
   10    15        INIT_METHOD_CALL                                         !0, 'modify'
         16        SEND_VAL_EX                                              '%2B15+minutes'
         17        DO_FCALL                                      0          
   11    18        INIT_METHOD_CALL                                         !0, 'format'
         19        SEND_VAL_EX                                              'H%3Ai'
         20        DO_FCALL                                      0  $15     
         21        ASSIGN_OP                                     8          !3, $15
   13    22        ASSIGN_DIM                                               !2
         23        OP_DATA                                                  !3
    7    24    >   IS_SMALLER                                               !0, !1
         25      > JMPNZ                                                    ~18, ->10
   16    26    >   INIT_FCALL                                               'print_r'
         27        SEND_VAR                                                 !2
         28        DO_ICALL                                                 
         29      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
173.4 ms | 941 KiB | 16 Q