3v4l.org

run code in 300+ PHP versions simultaneously
<?php if (class_exists('DateTime')) { $date = new DateTime('2013-10-31'); $date->modify('-1 month'); print "2013-10-31, -1 month: {$date->format('m')}\n"; $date = new DateTime('2013-10-31'); $date->modify('first day of 1 month ago'); print "2013-10-31, first day of 1 month ago: {$date->format('m')}"; } else { print 'Not supported.'; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 32
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 33
Branch analysis from position: 33
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 32
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/tclFA
function name:  (null)
number of ops:  34
compiled vars:  !0 = $date
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'class_exists'
          1        SEND_VAL                                                 'DateTime'
          2        DO_ICALL                                         $1      
          3      > JMPZ                                                     $1, ->32
    4     4    >   NEW                                              $2      'DateTime'
          5        SEND_VAL_EX                                              '2013-10-31'
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !0, $2
    5     8        INIT_METHOD_CALL                                         !0, 'modify'
          9        SEND_VAL_EX                                              '-1+month'
         10        DO_FCALL                                      0          
    6    11        ROPE_INIT                                     3  ~8      '2013-10-31%2C+-1+month%3A+'
         12        INIT_METHOD_CALL                                         !0, 'format'
         13        SEND_VAL_EX                                              'm'
         14        DO_FCALL                                      0  $6      
         15        ROPE_ADD                                      1  ~8      ~8, $6
         16        ROPE_END                                      2  ~7      ~8, '%0A'
         17        ECHO                                                     ~7
    7    18        NEW                                              $10     'DateTime'
         19        SEND_VAL_EX                                              '2013-10-31'
         20        DO_FCALL                                      0          
         21        ASSIGN                                                   !0, $10
    8    22        INIT_METHOD_CALL                                         !0, 'modify'
         23        SEND_VAL_EX                                              'first+day+of+1+month+ago'
         24        DO_FCALL                                      0          
    9    25        NOP                                                      
         26        INIT_METHOD_CALL                                         !0, 'format'
         27        SEND_VAL_EX                                              'm'
         28        DO_FCALL                                      0  $14     
         29        FAST_CONCAT                                      ~15     '2013-10-31%2C+first+day+of+1+month+ago%3A+', $14
         30        ECHO                                                     ~15
         31      > JMP                                                      ->33
   11    32    >   ECHO                                                     'Not+supported.'
   12    33    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.89 ms | 1401 KiB | 15 Q