3v4l.org

run code in 300+ PHP versions simultaneously
<?php $currentDate = new DateTimeImmutable(); $firstOfTheMonth = new DateTimeImmutable($currentDate->format('Y-m-1')); var_dump($firstOfTheMonth->modify("-1 month"));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cu6vT
function name:  (null)
number of ops:  17
compiled vars:  !0 = $currentDate, !1 = $firstOfTheMonth
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   NEW                                              $2      'DateTimeImmutable'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
    3     3        NEW                                              $5      'DateTimeImmutable'
          4        INIT_METHOD_CALL                                         !0, 'format'
          5        SEND_VAL_EX                                              'Y-m-1'
          6        DO_FCALL                                      0  $6      
          7        SEND_VAR_NO_REF_EX                                       $6
          8        DO_FCALL                                      0          
          9        ASSIGN                                                   !1, $5
    4    10        INIT_FCALL                                               'var_dump'
         11        INIT_METHOD_CALL                                         !1, 'modify'
         12        SEND_VAL_EX                                              '-1+month'
         13        DO_FCALL                                      0  $9      
         14        SEND_VAR                                                 $9
         15        DO_ICALL                                                 
         16      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
142.59 ms | 1001 KiB | 14 Q