3v4l.org

run code in 300+ PHP versions simultaneously
<?php $from = new DateTime('1970-01-01 22:00:00'); $to = (clone $from); $to->modify('+5 hours'); $dp = new DatePeriod($from, new DateInterval('P1H'), $to); $r = array(); foreach ($dp as $d) { $r[] = $d->format('hA'); } print_r($r);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 20, Position 2 = 27
Branch analysis from position: 20
2 jumps found. (Code = 78) Position 1 = 21, Position 2 = 27
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
Branch analysis from position: 27
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 27
filename:       /in/huu1a
function name:  (null)
number of ops:  32
compiled vars:  !0 = $from, !1 = $to, !2 = $dp, !3 = $r, !4 = $d
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $5      'DateTime'
          1        SEND_VAL_EX                                              '1970-01-01+22%3A00%3A00'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $5
    4     4        CLONE                                            ~8      !0
          5        ASSIGN                                                   !1, ~8
    5     6        INIT_METHOD_CALL                                         !1, 'modify'
          7        SEND_VAL_EX                                              '%2B5+hours'
          8        DO_FCALL                                      0          
    7     9        NEW                                              $11     'DatePeriod'
         10        SEND_VAR_EX                                              !0
         11        NEW                                              $12     'DateInterval'
         12        SEND_VAL_EX                                              'P1H'
         13        DO_FCALL                                      0          
         14        SEND_VAR_NO_REF_EX                                       $12
         15        SEND_VAR_EX                                              !1
         16        DO_FCALL                                      0          
         17        ASSIGN                                                   !2, $11
    8    18        ASSIGN                                                   !3, <array>
   10    19      > FE_RESET_R                                       $17     !2, ->27
         20    > > FE_FETCH_R                                               $17, !4, ->27
   11    21    >   INIT_METHOD_CALL                                         !4, 'format'
         22        SEND_VAL_EX                                              'hA'
         23        DO_FCALL                                      0  $19     
         24        ASSIGN_DIM                                               !3
         25        OP_DATA                                                  $19
   10    26      > JMP                                                      ->20
         27    >   FE_FREE                                                  $17
   14    28        INIT_FCALL                                               'print_r'
         29        SEND_VAR                                                 !3
         30        DO_ICALL                                                 
         31      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.83 ms | 1396 KiB | 15 Q