3v4l.org

run code in 300+ PHP versions simultaneously
<?php $start = strtotime('2014-10-05'); $end = strtotime('2014-10-31'); $stamp = $start; $months = array(); do { $next_stamp = mktime(0,0,0, date('n',$stamp)+1, 1, date('Y',$stamp)); $months[] = ($next_stamp-$stamp)/3600/24/date('t', $stamp); $stamp = $next_stamp; } while ($stamp < $end); var_dump($months);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 44) Position 1 = 41, Position 2 = 10
Branch analysis from position: 41
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
filename:       /in/A1MXa
function name:  (null)
number of ops:  45
compiled vars:  !0 = $start, !1 = $end, !2 = $stamp, !3 = $months, !4 = $next_stamp
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'strtotime'
          1        SEND_VAL                                                 '2014-10-05'
          2        DO_ICALL                                         $5      
          3        ASSIGN                                                   !0, $5
    4     4        INIT_FCALL                                               'strtotime'
          5        SEND_VAL                                                 '2014-10-31'
          6        DO_ICALL                                         $7      
          7        ASSIGN                                                   !1, $7
    5     8        ASSIGN                                                   !2, !0
    6     9        ASSIGN                                                   !3, <array>
    8    10    >   INIT_FCALL                                               'mktime'
         11        SEND_VAL                                                 0
         12        SEND_VAL                                                 0
         13        SEND_VAL                                                 0
         14        INIT_FCALL                                               'date'
         15        SEND_VAL                                                 'n'
         16        SEND_VAR                                                 !2
         17        DO_ICALL                                         $11     
         18        ADD                                              ~12     $11, 1
         19        SEND_VAL                                                 ~12
         20        SEND_VAL                                                 1
         21        INIT_FCALL                                               'date'
         22        SEND_VAL                                                 'Y'
         23        SEND_VAR                                                 !2
         24        DO_ICALL                                         $13     
         25        SEND_VAR                                                 $13
         26        DO_ICALL                                         $14     
         27        ASSIGN                                                   !4, $14
    9    28        SUB                                              ~17     !4, !2
         29        DIV                                              ~18     ~17, 3600
         30        DIV                                              ~19     ~18, 24
         31        INIT_FCALL                                               'date'
         32        SEND_VAL                                                 't'
         33        SEND_VAR                                                 !2
         34        DO_ICALL                                         $20     
         35        DIV                                              ~21     ~19, $20
         36        ASSIGN_DIM                                               !3
         37        OP_DATA                                                  ~21
   10    38        ASSIGN                                                   !2, !4
   11    39        IS_SMALLER                                               !2, !1
         40      > JMPNZ                                                    ~23, ->10
   13    41    >   INIT_FCALL                                               'var_dump'
         42        SEND_VAR                                                 !3
         43        DO_ICALL                                                 
         44      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
173.55 ms | 1400 KiB | 21 Q