3v4l.org

run code in 300+ PHP versions simultaneously
<?php $firstAvailableCount = 100; $slice = 'monthly'; $countData = array(); $startDateTime = new DateTime("2016-01-01"); $endDateTime = new DateTime("2016-02-02"); fillCountMapPeriod($startDateTime,$endDateTime,$countData,$firstAvailableCount,$slice); function fillCountMapPeriod( DateTime $startDateTime, DateTime $endDateTime, array $countData, $firstAvailableCount, $slice) { if($slice == 'monthly') { $interval = new DateInterval('P1M'); $format = 'm-Y'; $startDateTime = DateTime::createFromFormat($format,$startDateTime->format($format)); } else { $interval = new DateInterval('P1W'); $format = 'W-Y'; } var_dump($startDateTime); if($startDateTime->format($format) == $endDateTime->format($format)) { var_dump($startDateTime->format($format)); return; } $endDateTime->add($interval); var_dump($endDateTime); while($startDateTime <= $endDateTime){ var_dump($startDateTime->format("d-".$format)); $startDateTime->add($interval); } }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/uJEut
function name:  (null)
number of ops:  19
compiled vars:  !0 = $firstAvailableCount, !1 = $slice, !2 = $countData, !3 = $startDateTime, !4 = $endDateTime
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 100
    4     1        ASSIGN                                                   !1, 'monthly'
    5     2        ASSIGN                                                   !2, <array>
    7     3        NEW                                              $8      'DateTime'
          4        SEND_VAL_EX                                              '2016-01-01'
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !3, $8
    8     7        NEW                                              $11     'DateTime'
          8        SEND_VAL_EX                                              '2016-02-02'
          9        DO_FCALL                                      0          
         10        ASSIGN                                                   !4, $11
   10    11        INIT_FCALL_BY_NAME                                       'fillCountMapPeriod'
         12        SEND_VAR_EX                                              !3
         13        SEND_VAR_EX                                              !4
         14        SEND_VAR_EX                                              !2
         15        SEND_VAR_EX                                              !0
         16        SEND_VAR_EX                                              !1
         17        DO_FCALL                                      0          
   34    18      > RETURN                                                   1

Function fillcountmapperiod:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 21
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 26
Branch analysis from position: 26
2 jumps found. (Code = 43) Position 1 = 37, Position 2 = 44
Branch analysis from position: 37
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 44
1 jumps found. (Code = 42) Position 1 = 61
Branch analysis from position: 61
2 jumps found. (Code = 44) Position 1 = 63, Position 2 = 51
Branch analysis from position: 63
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 51
2 jumps found. (Code = 44) Position 1 = 63, Position 2 = 51
Branch analysis from position: 63
Branch analysis from position: 51
Branch analysis from position: 21
2 jumps found. (Code = 43) Position 1 = 37, Position 2 = 44
Branch analysis from position: 37
Branch analysis from position: 44
filename:       /in/uJEut
function name:  fillCountMapPeriod
number of ops:  64
compiled vars:  !0 = $startDateTime, !1 = $endDateTime, !2 = $countData, !3 = $firstAvailableCount, !4 = $slice, !5 = $interval, !6 = $format
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
          3        RECV                                             !3      
          4        RECV                                             !4      
   14     5        IS_EQUAL                                                 !4, 'monthly'
          6      > JMPZ                                                     ~7, ->21
   15     7    >   NEW                                              $8      'DateInterval'
          8        SEND_VAL_EX                                              'P1M'
          9        DO_FCALL                                      0          
         10        ASSIGN                                                   !5, $8
   16    11        ASSIGN                                                   !6, 'm-Y'
   17    12        INIT_STATIC_METHOD_CALL                                  'DateTime', 'createFromFormat'
         13        SEND_VAR                                                 !6
         14        INIT_METHOD_CALL                                         !0, 'format'
         15        SEND_VAR_EX                                              !6
         16        DO_FCALL                                      0  $12     
         17        SEND_VAR                                                 $12
         18        DO_FCALL                                      0  $13     
         19        ASSIGN                                                   !0, $13
         20      > JMP                                                      ->26
   19    21    >   NEW                                              $15     'DateInterval'
         22        SEND_VAL_EX                                              'P1W'
         23        DO_FCALL                                      0          
         24        ASSIGN                                                   !5, $15
   20    25        ASSIGN                                                   !6, 'W-Y'
   22    26    >   INIT_FCALL                                               'var_dump'
         27        SEND_VAR                                                 !0
         28        DO_ICALL                                                 
   24    29        INIT_METHOD_CALL                                         !0, 'format'
         30        SEND_VAR_EX                                              !6
         31        DO_FCALL                                      0  $20     
         32        INIT_METHOD_CALL                                         !1, 'format'
         33        SEND_VAR_EX                                              !6
         34        DO_FCALL                                      0  $21     
         35        IS_EQUAL                                                 $20, $21
         36      > JMPZ                                                     ~22, ->44
   25    37    >   INIT_FCALL                                               'var_dump'
         38        INIT_METHOD_CALL                                         !0, 'format'
         39        SEND_VAR_EX                                              !6
         40        DO_FCALL                                      0  $23     
         41        SEND_VAR                                                 $23
         42        DO_ICALL                                                 
   26    43      > RETURN                                                   null
   28    44    >   INIT_METHOD_CALL                                         !1, 'add'
         45        SEND_VAR_EX                                              !5
         46        DO_FCALL                                      0          
   29    47        INIT_FCALL                                               'var_dump'
         48        SEND_VAR                                                 !1
         49        DO_ICALL                                                 
   30    50      > JMP                                                      ->61
   31    51    >   INIT_FCALL                                               'var_dump'
         52        INIT_METHOD_CALL                                         !0, 'format'
         53        CONCAT                                           ~27     'd-', !6
         54        SEND_VAL_EX                                              ~27
         55        DO_FCALL                                      0  $28     
         56        SEND_VAR                                                 $28
         57        DO_ICALL                                                 
   32    58        INIT_METHOD_CALL                                         !0, 'add'
         59        SEND_VAR_EX                                              !5
         60        DO_FCALL                                      0          
   30    61    >   IS_SMALLER_OR_EQUAL                                      !0, !1
         62      > JMPNZ                                                    ~31, ->51
   34    63    > > RETURN                                                   null

End of function fillcountmapperiod

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.34 ms | 1404 KiB | 15 Q