3v4l.org

run code in 300+ PHP versions simultaneously
<?php $date = new \DateTime('2018-10-31'); echo $date->format('Y-m-d'), PHP_EOL; for ($i = 0; $i < 6; ++$i) { $date->modify('last day of next month'); echo $date->format('Y-m-d'), PHP_EOL; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
2 jumps found. (Code = 44) Position 1 = 22, Position 2 = 11
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
2 jumps found. (Code = 44) Position 1 = 22, Position 2 = 11
Branch analysis from position: 22
Branch analysis from position: 11
filename:       /in/tsk8G
function name:  (null)
number of ops:  23
compiled vars:  !0 = $date, !1 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $2      'DateTime'
          1        SEND_VAL_EX                                              '2018-10-31'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $2
    4     4        INIT_METHOD_CALL                                         !0, 'format'
          5        SEND_VAL_EX                                              'Y-m-d'
          6        DO_FCALL                                      0  $5      
          7        ECHO                                                     $5
          8        ECHO                                                     '%0A'
    6     9        ASSIGN                                                   !1, 0
         10      > JMP                                                      ->20
    7    11    >   INIT_METHOD_CALL                                         !0, 'modify'
         12        SEND_VAL_EX                                              'last+day+of+next+month'
         13        DO_FCALL                                      0          
    8    14        INIT_METHOD_CALL                                         !0, 'format'
         15        SEND_VAL_EX                                              'Y-m-d'
         16        DO_FCALL                                      0  $8      
         17        ECHO                                                     $8
         18        ECHO                                                     '%0A'
    6    19        PRE_INC                                                  !1
         20    >   IS_SMALLER                                               !1, 6
         21      > JMPNZ                                                    ~10, ->11
    9    22    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.34 ms | 1394 KiB | 13 Q