3v4l.org

run code in 300+ PHP versions simultaneously
<?php $time = '2019-10-10 18:25:00'; $durations = [10, 20, 30, 40, 50, 60, 70, 80, 90, 100]; foreach($durations as $duration) { $date = new DateTime($time); $date->add(new DateInterval('PT'.$duration.'S')); echo $date->format('Y-m-d H:i:s').PHP_EOL; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 22
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 22
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
filename:       /in/qd6DQ
function name:  (null)
number of ops:  24
compiled vars:  !0 = $time, !1 = $durations, !2 = $duration, !3 = $date
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '2019-10-10+18%3A25%3A00'
    4     1        ASSIGN                                                   !1, <array>
    6     2      > FE_RESET_R                                       $6      !1, ->22
          3    > > FE_FETCH_R                                               $6, !2, ->22
    7     4    >   NEW                                              $7      'DateTime'
          5        SEND_VAR_EX                                              !0
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !3, $7
    8     8        INIT_METHOD_CALL                                         !3, 'add'
          9        NEW                                              $10     'DateInterval'
         10        CONCAT                                           ~11     'PT', !2
         11        CONCAT                                           ~12     ~11, 'S'
         12        SEND_VAL_EX                                              ~12
         13        DO_FCALL                                      0          
         14        SEND_VAR_NO_REF_EX                                       $10
         15        DO_FCALL                                      0          
   10    16        INIT_METHOD_CALL                                         !3, 'format'
         17        SEND_VAL_EX                                              'Y-m-d+H%3Ai%3As'
         18        DO_FCALL                                      0  $15     
         19        CONCAT                                           ~16     $15, '%0A'
         20        ECHO                                                     ~16
    6    21      > JMP                                                      ->3
         22    >   FE_FREE                                                  $6
   11    23      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
173.14 ms | 1398 KiB | 13 Q