3v4l.org

run code in 300+ PHP versions simultaneously
<?php $start = "20141001T06:07:00"; $end = "20141007T06:07:00"; //$start = date_create(date('Y-m-d H:i:s', strtotime($start))); //$end = date_create(date('Y-m-d H:i:s', strtotime($end))); $start = new DateTime($start); $end = new DateTime($end); $interval = $start->diff($end); $j = $interval->format('%a'); //echo $j; for($i=0; $i < $interval->format('%a'); $i++){ $newDate = $start->add(new DateInterval('P'.$i.'D')); echo $newDate; } //echo $interval->format('%R%a days');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 31
Branch analysis from position: 31
2 jumps found. (Code = 44) Position 1 = 36, Position 2 = 20
Branch analysis from position: 36
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
2 jumps found. (Code = 44) Position 1 = 36, Position 2 = 20
Branch analysis from position: 36
Branch analysis from position: 20
filename:       /in/0mc7C
function name:  (null)
number of ops:  37
compiled vars:  !0 = $start, !1 = $end, !2 = $interval, !3 = $j, !4 = $i, !5 = $newDate
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '20141001T06%3A07%3A00'
    3     1        ASSIGN                                                   !1, '20141007T06%3A07%3A00'
    8     2        NEW                                              $8      'DateTime'
          3        SEND_VAR_EX                                              !0
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !0, $8
    9     6        NEW                                              $11     'DateTime'
          7        SEND_VAR_EX                                              !1
          8        DO_FCALL                                      0          
          9        ASSIGN                                                   !1, $11
   11    10        INIT_METHOD_CALL                                         !0, 'diff'
         11        SEND_VAR_EX                                              !1
         12        DO_FCALL                                      0  $14     
         13        ASSIGN                                                   !2, $14
   13    14        INIT_METHOD_CALL                                         !2, 'format'
         15        SEND_VAL_EX                                              '%25a'
         16        DO_FCALL                                      0  $16     
         17        ASSIGN                                                   !3, $16
   16    18        ASSIGN                                                   !4, 0
         19      > JMP                                                      ->31
   17    20    >   INIT_METHOD_CALL                                         !0, 'add'
         21        NEW                                              $19     'DateInterval'
         22        CONCAT                                           ~20     'P', !4
         23        CONCAT                                           ~21     ~20, 'D'
         24        SEND_VAL_EX                                              ~21
         25        DO_FCALL                                      0          
         26        SEND_VAR_NO_REF_EX                                       $19
         27        DO_FCALL                                      0  $23     
         28        ASSIGN                                                   !5, $23
   18    29        ECHO                                                     !5
   16    30        PRE_INC                                                  !4
         31    >   INIT_METHOD_CALL                                         !2, 'format'
         32        SEND_VAL_EX                                              '%25a'
         33        DO_FCALL                                      0  $26     
         34        IS_SMALLER                                               !4, $26
         35      > JMPNZ                                                    ~27, ->20
   22    36    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.1 ms | 1395 KiB | 13 Q