3v4l.org

run code in 300+ PHP versions simultaneously
<?php $date = new DateTime( '2016-08-25' ); echo $date->format('Y-m-d'),"\n"; $day = $date->format('j'); $date->modify('first day of sixth month'); $date->modify('+' . (min($day, $date->format('t')) - 1) . ' days'); echo $date->format('Y-m-d');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NMVXL
function name:  (null)
number of ops:  34
compiled vars:  !0 = $date, !1 = $day
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $2      'DateTime'
          1        SEND_VAL_EX                                              '2016-08-25'
          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'
    5     9        INIT_METHOD_CALL                                         !0, 'format'
         10        SEND_VAL_EX                                              'j'
         11        DO_FCALL                                      0  $6      
         12        ASSIGN                                                   !1, $6
    6    13        INIT_METHOD_CALL                                         !0, 'modify'
         14        SEND_VAL_EX                                              'first+day+of+sixth+month'
         15        DO_FCALL                                      0          
    7    16        INIT_METHOD_CALL                                         !0, 'modify'
         17        INIT_FCALL                                               'min'
         18        SEND_VAR                                                 !1
         19        INIT_METHOD_CALL                                         !0, 'format'
         20        SEND_VAL_EX                                              't'
         21        DO_FCALL                                      0  $9      
         22        SEND_VAR                                                 $9
         23        DO_ICALL                                         $10     
         24        SUB                                              ~11     $10, 1
         25        CONCAT                                           ~12     '%2B', ~11
         26        CONCAT                                           ~13     ~12, '+days'
         27        SEND_VAL_EX                                              ~13
         28        DO_FCALL                                      0          
    8    29        INIT_METHOD_CALL                                         !0, 'format'
         30        SEND_VAL_EX                                              'Y-m-d'
         31        DO_FCALL                                      0  $15     
         32        ECHO                                                     $15
         33      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.56 ms | 1452 KiB | 14 Q