3v4l.org

run code in 300+ PHP versions simultaneously
<?php print_r(get_thirty_days((new \DateTime())->getTimestamp())); function get_thirty_days(int $start_date_ts, int $days = null) { $days = $days ?? 30; $dates = []; while ($days--) { $dates[] = date('Y-m-d', $start_date_ts + ($days * (60 * 60 * 24))); } return $dates; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UXPA0
function name:  (null)
number of ops:  11
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'print_r'
          1        INIT_FCALL_BY_NAME                                       'get_thirty_days'
          2        NEW                                              $0      'DateTime'
          3        DO_FCALL                                      0          
          4        INIT_METHOD_CALL                                         $0, 'getTimestamp'
          5        DO_FCALL                                      0  $2      
          6        SEND_VAR_NO_REF_EX                                       $2
          7        DO_FCALL                                      0  $3      
          8        SEND_VAR                                                 $3
          9        DO_ICALL                                                 
   14    10      > RETURN                                                   1

Function get_thirty_days:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
2 jumps found. (Code = 44) Position 1 = 17, Position 2 = 7
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
2 jumps found. (Code = 44) Position 1 = 17, Position 2 = 7
Branch analysis from position: 17
Branch analysis from position: 7
filename:       /in/UXPA0
function name:  get_thirty_days
number of ops:  19
compiled vars:  !0 = $start_date_ts, !1 = $days, !2 = $dates
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      null
    6     2        COALESCE                                         ~3      !1
          3        QM_ASSIGN                                        ~3      30
          4        ASSIGN                                                   !1, ~3
    7     5        ASSIGN                                                   !2, <array>
    9     6      > JMP                                                      ->15
   10     7    >   INIT_FCALL                                               'date'
          8        SEND_VAL                                                 'Y-m-d'
          9        MUL                                              ~7      !1, 86400
         10        ADD                                              ~8      !0, ~7
         11        SEND_VAL                                                 ~8
         12        DO_ICALL                                         $9      
         13        ASSIGN_DIM                                               !2
         14        OP_DATA                                                  $9
    9    15    >   POST_DEC                                         ~10     !1
         16      > JMPNZ                                                    ~10, ->7
   13    17    > > RETURN                                                   !2
   14    18*     > RETURN                                                   null

End of function get_thirty_days

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
135.33 ms | 1002 KiB | 15 Q