3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getTimeStamps($numDays){ $dates = array(); for ($i=$numDays-1;$i>=0;$i--){ $dates[] = date("Y-m-d", strtotime("today - $i days")); } return $dates; } print_r(getTimeStamps(8)) ;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/KSvTC
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   INIT_FCALL                                               'print_r'
          1        INIT_FCALL                                               'gettimestamps'
          2        SEND_VAL                                                 8
          3        DO_FCALL                                      0  $0      
          4        SEND_VAR                                                 $0
          5        DO_ICALL                                                 
          6      > RETURN                                                   1

Function gettimestamps:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
2 jumps found. (Code = 44) Position 1 = 20, Position 2 = 5
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
2 jumps found. (Code = 44) Position 1 = 20, Position 2 = 5
Branch analysis from position: 20
Branch analysis from position: 5
filename:       /in/KSvTC
function name:  getTimeStamps
number of ops:  22
compiled vars:  !0 = $numDays, !1 = $dates, !2 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    3     1        ASSIGN                                                   !1, <array>
    4     2        SUB                                              ~4      !0, 1
          3        ASSIGN                                                   !2, ~4
          4      > JMP                                                      ->18
    5     5    >   INIT_FCALL                                               'date'
          6        SEND_VAL                                                 'Y-m-d'
          7        INIT_FCALL                                               'strtotime'
          8        ROPE_INIT                                     3  ~8      'today+-+'
          9        ROPE_ADD                                      1  ~8      ~8, !2
         10        ROPE_END                                      2  ~7      ~8, '+days'
         11        SEND_VAL                                                 ~7
         12        DO_ICALL                                         $10     
         13        SEND_VAR                                                 $10
         14        DO_ICALL                                         $11     
         15        ASSIGN_DIM                                               !1
         16        OP_DATA                                                  $11
    4    17        PRE_DEC                                                  !2
         18    >   IS_SMALLER_OR_EQUAL                                      0, !2
         19      > JMPNZ                                                    ~13, ->5
    7    20    > > RETURN                                                   !1
    8    21*     > RETURN                                                   null

End of function gettimestamps

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
166.12 ms | 1399 KiB | 20 Q