3v4l.org

run code in 300+ PHP versions simultaneously
<?php function dateRange($first, $last, $step = '+1 day', $format = 'd/m/Y' ) { echo $first; echo "<br>"; echo $last; echo "<br>"; echo $step; echo "<br>"; $dates = array(); $current = strtotime($first); $last = strtotime($last); while( $current <= $last ) { $dates[] = date($format, $current); $current = strtotime($step, $current); } print_r($dates); exit; return $dates; } dateRange('20/05/2014', '31/05/2014');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5VCOC
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   INIT_FCALL                                               'daterange'
          1        SEND_VAL                                                 '20%2F05%2F2014'
          2        SEND_VAL                                                 '31%2F05%2F2014'
          3        DO_FCALL                                      0          
          4      > RETURN                                                   1

Function daterange:
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 = 33, Position 2 = 20
Branch analysis from position: 33
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 20
2 jumps found. (Code = 44) Position 1 = 33, Position 2 = 20
Branch analysis from position: 33
Branch analysis from position: 20
filename:       /in/5VCOC
function name:  dateRange
number of ops:  39
compiled vars:  !0 = $first, !1 = $last, !2 = $step, !3 = $format, !4 = $dates, !5 = $current
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV_INIT                                        !2      '%2B1+day'
          3        RECV_INIT                                        !3      'd%2Fm%2FY'
    5     4        ECHO                                                     !0
    6     5        ECHO                                                     '%3Cbr%3E'
    7     6        ECHO                                                     !1
    8     7        ECHO                                                     '%3Cbr%3E'
    9     8        ECHO                                                     !2
   10     9        ECHO                                                     '%3Cbr%3E'
   11    10        ASSIGN                                                   !4, <array>
   12    11        INIT_FCALL                                               'strtotime'
         12        SEND_VAR                                                 !0
         13        DO_ICALL                                         $7      
         14        ASSIGN                                                   !5, $7
   13    15        INIT_FCALL                                               'strtotime'
         16        SEND_VAR                                                 !1
         17        DO_ICALL                                         $9      
         18        ASSIGN                                                   !1, $9
   14    19      > JMP                                                      ->31
   16    20    >   INIT_FCALL                                               'date'
         21        SEND_VAR                                                 !3
         22        SEND_VAR                                                 !5
         23        DO_ICALL                                         $12     
         24        ASSIGN_DIM                                               !4
         25        OP_DATA                                                  $12
   17    26        INIT_FCALL                                               'strtotime'
         27        SEND_VAR                                                 !2
         28        SEND_VAR                                                 !5
         29        DO_ICALL                                         $13     
         30        ASSIGN                                                   !5, $13
   14    31    >   IS_SMALLER_OR_EQUAL                                      !5, !1
         32      > JMPNZ                                                    ~15, ->20
   19    33    >   INIT_FCALL                                               'print_r'
         34        SEND_VAR                                                 !4
         35        DO_ICALL                                                 
   20    36      > EXIT                                                     
   21    37*       RETURN                                                   !4
   22    38*     > RETURN                                                   null

End of function daterange

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.06 ms | 1403 KiB | 20 Q