3v4l.org

run code in 300+ PHP versions simultaneously
<?php $quarters = array(15, 30, 45, 60); $diff = 15; foreach($quarters as $quarter){ $curDiff = $quarter - date('i'); if($curDiff < $diff && $curDiff > 0){ $diff = $curDiff; } } $dt = new DateTime; $dt->add(new DateInterval('PT'.$diff.'M')); echo $dt->format('Y-m-d H:i:00');
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 16
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 16
Branch analysis from position: 4
2 jumps found. (Code = 46) Position 1 = 11, Position 2 = 13
Branch analysis from position: 11
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 15
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 15
Branch analysis from position: 13
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
filename:       /in/dVuhN
function name:  (null)
number of ops:  33
compiled vars:  !0 = $quarters, !1 = $diff, !2 = $quarter, !3 = $curDiff, !4 = $dt
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        ASSIGN                                                   !1, 15
    5     2      > FE_RESET_R                                       $7      !0, ->16
          3    > > FE_FETCH_R                                               $7, !2, ->16
    6     4    >   INIT_FCALL                                               'date'
          5        SEND_VAL                                                 'i'
          6        DO_ICALL                                         $8      
          7        SUB                                              ~9      !2, $8
          8        ASSIGN                                                   !3, ~9
    7     9        IS_SMALLER                                       ~11     !3, !1
         10      > JMPZ_EX                                          ~11     ~11, ->13
         11    >   IS_SMALLER                                       ~12     0, !3
         12        BOOL                                             ~11     ~12
         13    > > JMPZ                                                     ~11, ->15
    8    14    >   ASSIGN                                                   !1, !3
    5    15    > > JMP                                                      ->3
         16    >   FE_FREE                                                  $7
   12    17        NEW                                              $14     'DateTime'
         18        DO_FCALL                                      0          
         19        ASSIGN                                                   !4, $14
   13    20        INIT_METHOD_CALL                                         !4, 'add'
         21        NEW                                              $17     'DateInterval'
         22        CONCAT                                           ~18     'PT', !1
         23        CONCAT                                           ~19     ~18, 'M'
         24        SEND_VAL_EX                                              ~19
         25        DO_FCALL                                      0          
         26        SEND_VAR_NO_REF_EX                                       $17
         27        DO_FCALL                                      0          
   14    28        INIT_METHOD_CALL                                         !4, 'format'
         29        SEND_VAL_EX                                              'Y-m-d+H%3Ai%3A00'
         30        DO_FCALL                                      0  $22     
         31        ECHO                                                     $22
         32      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.32 ms | 1396 KiB | 15 Q