3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getDatesFromRange($start, $end) { $realEnd = new DateTime($end); $realEnd->add(new DateInterval('P1D')); $period = new DatePeriod( new DateTime($start), new DateInterval('P1D'), $realEnd ); foreach($period as $date) { $array[] = $date->format('Y-m-d'); } return $array; } print_r( getDatesFromRange('2010-10-01', '2010-10-05') );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/c9927
function name:  (null)
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   INIT_FCALL                                               'print_r'
          1        INIT_FCALL                                               'getdatesfromrange'
          2        SEND_VAL                                                 '2010-10-01'
          3        SEND_VAL                                                 '2010-10-05'
          4        DO_FCALL                                      0  $0      
          5        SEND_VAR                                                 $0
          6        DO_ICALL                                                 
          7      > RETURN                                                   1

Function getdatesfromrange:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 25, Position 2 = 32
Branch analysis from position: 25
2 jumps found. (Code = 78) Position 1 = 26, Position 2 = 32
Branch analysis from position: 26
1 jumps found. (Code = 42) Position 1 = 25
Branch analysis from position: 25
Branch analysis from position: 32
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 32
filename:       /in/c9927
function name:  getDatesFromRange
number of ops:  35
compiled vars:  !0 = $start, !1 = $end, !2 = $realEnd, !3 = $period, !4 = $date, !5 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    3     2        NEW                                              $6      'DateTime'
          3        SEND_VAR_EX                                              !1
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !2, $6
    4     6        INIT_METHOD_CALL                                         !2, 'add'
          7        NEW                                              $9      'DateInterval'
          8        SEND_VAL_EX                                              'P1D'
          9        DO_FCALL                                      0          
         10        SEND_VAR_NO_REF_EX                                       $9
         11        DO_FCALL                                      0          
    6    12        NEW                                              $12     'DatePeriod'
    7    13        NEW                                              $13     'DateTime'
         14        SEND_VAR_EX                                              !0
         15        DO_FCALL                                      0          
         16        SEND_VAR_NO_REF_EX                                       $13
    8    17        NEW                                              $15     'DateInterval'
         18        SEND_VAL_EX                                              'P1D'
         19        DO_FCALL                                      0          
         20        SEND_VAR_NO_REF_EX                                       $15
    7    21        SEND_VAR_EX                                              !2
         22        DO_FCALL                                      0          
    6    23        ASSIGN                                                   !3, $12
   12    24      > FE_RESET_R                                       $19     !3, ->32
         25    > > FE_FETCH_R                                               $19, !4, ->32
   13    26    >   INIT_METHOD_CALL                                         !4, 'format'
         27        SEND_VAL_EX                                              'Y-m-d'
         28        DO_FCALL                                      0  $21     
         29        ASSIGN_DIM                                               !5
         30        OP_DATA                                                  $21
   12    31      > JMP                                                      ->25
         32    >   FE_FREE                                                  $19
   16    33      > RETURN                                                   !5
   17    34*     > RETURN                                                   null

End of function getdatesfromrange

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.45 ms | 1403 KiB | 16 Q