3v4l.org

run code in 300+ PHP versions simultaneously
<?php $initialDate = "2011-07-31"; for($i=1; $i<=5; $i++) { echo date('Y-m-d', strtotime('last day of -' . $i . ' month', strtotime($initialDate))) . "\n"; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
2 jumps found. (Code = 44) Position 1 = 21, Position 2 = 3
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 3
2 jumps found. (Code = 44) Position 1 = 21, Position 2 = 3
Branch analysis from position: 21
Branch analysis from position: 3
filename:       /in/pCV7U
function name:  (null)
number of ops:  22
compiled vars:  !0 = $initialDate, !1 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '2011-07-31'
    4     1        ASSIGN                                                   !1, 1
          2      > JMP                                                      ->19
    5     3    >   INIT_FCALL                                               'date'
          4        SEND_VAL                                                 'Y-m-d'
          5        INIT_FCALL                                               'strtotime'
          6        CONCAT                                           ~4      'last+day+of+-', !1
          7        CONCAT                                           ~5      ~4, '+month'
          8        SEND_VAL                                                 ~5
          9        INIT_FCALL                                               'strtotime'
         10        SEND_VAR                                                 !0
         11        DO_ICALL                                         $6      
         12        SEND_VAR                                                 $6
         13        DO_ICALL                                         $7      
         14        SEND_VAR                                                 $7
         15        DO_ICALL                                         $8      
         16        CONCAT                                           ~9      $8, '%0A'
         17        ECHO                                                     ~9
    4    18        PRE_INC                                                  !1
         19    >   IS_SMALLER_OR_EQUAL                                      !1, 5
         20      > JMPNZ                                                    ~11, ->3
    6    21    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
135.83 ms | 1000 KiB | 15 Q