3v4l.org

run code in 300+ PHP versions simultaneously
<?php $currentDate = new DateTime('2016-01-01'); $reportEndDate = new DateTime('2016-05-31'); $months = $currentDate->diff($reportEndDate)->m; var_export($months); var_export("\n"); for ($i = 1; $i <= $months ; $i++) { $currentDateImmutable = \DateTimeImmutable::createFromMutable($currentDate); $daysUntilNextMonth = $currentDateImmutable->diff($currentDateImmutable->modify('last day of this month'))->d; var_export($daysUntilNextMonth); var_export("\n"); for ($j = 1; $j <= $daysUntilNextMonth ; $j++) { $currentDate->modify('+1 day'); } }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 48
Branch analysis from position: 48
2 jumps found. (Code = 44) Position 1 = 50, Position 2 = 21
Branch analysis from position: 50
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 45
Branch analysis from position: 45
2 jumps found. (Code = 44) Position 1 = 47, Position 2 = 41
Branch analysis from position: 47
2 jumps found. (Code = 44) Position 1 = 50, Position 2 = 21
Branch analysis from position: 50
Branch analysis from position: 21
Branch analysis from position: 41
2 jumps found. (Code = 44) Position 1 = 47, Position 2 = 41
Branch analysis from position: 47
Branch analysis from position: 41
filename:       /in/i32SP
function name:  (null)
number of ops:  51
compiled vars:  !0 = $currentDate, !1 = $reportEndDate, !2 = $months, !3 = $i, !4 = $currentDateImmutable, !5 = $daysUntilNextMonth, !6 = $j
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $7      'DateTime'
          1        SEND_VAL_EX                                              '2016-01-01'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $7
    4     4        NEW                                              $10     'DateTime'
          5        SEND_VAL_EX                                              '2016-05-31'
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !1, $10
    6     8        INIT_METHOD_CALL                                         !0, 'diff'
          9        SEND_VAR_EX                                              !1
         10        DO_FCALL                                      0  $13     
         11        FETCH_OBJ_R                                      ~14     $13, 'm'
         12        ASSIGN                                                   !2, ~14
    7    13        INIT_FCALL                                               'var_export'
         14        SEND_VAR                                                 !2
         15        DO_ICALL                                                 
    8    16        INIT_FCALL                                               'var_export'
         17        SEND_VAL                                                 '%0A'
         18        DO_ICALL                                                 
   10    19        ASSIGN                                                   !3, 1
         20      > JMP                                                      ->48
   12    21    >   INIT_STATIC_METHOD_CALL                                  'DateTimeImmutable', 'createFromMutable'
         22        SEND_VAR                                                 !0
         23        DO_FCALL                                      0  $19     
         24        ASSIGN                                                   !4, $19
   13    25        INIT_METHOD_CALL                                         !4, 'diff'
         26        INIT_METHOD_CALL                                         !4, 'modify'
         27        SEND_VAL_EX                                              'last+day+of+this+month'
         28        DO_FCALL                                      0  $21     
         29        SEND_VAR_NO_REF_EX                                       $21
         30        DO_FCALL                                      0  $22     
         31        FETCH_OBJ_R                                      ~23     $22, 'd'
         32        ASSIGN                                                   !5, ~23
   15    33        INIT_FCALL                                               'var_export'
         34        SEND_VAR                                                 !5
         35        DO_ICALL                                                 
   16    36        INIT_FCALL                                               'var_export'
         37        SEND_VAL                                                 '%0A'
         38        DO_ICALL                                                 
   18    39        ASSIGN                                                   !6, 1
         40      > JMP                                                      ->45
   19    41    >   INIT_METHOD_CALL                                         !0, 'modify'
         42        SEND_VAL_EX                                              '%2B1+day'
         43        DO_FCALL                                      0          
   18    44        PRE_INC                                                  !6
         45    >   IS_SMALLER_OR_EQUAL                                      !6, !5
         46      > JMPNZ                                                    ~30, ->41
   10    47    >   PRE_INC                                                  !3
         48    >   IS_SMALLER_OR_EQUAL                                      !3, !2
         49      > JMPNZ                                                    ~32, ->21
   22    50    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.06 ms | 1405 KiB | 15 Q