3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
140.02 ms | 1001 KiB | 14 Q