3v4l.org

run code in 300+ PHP versions simultaneously
<?php $time = strtotime(date('Y-m').'-01'); echo date('Y-m-d',$time); echo '<br>'.$final = date("Y-m-d", strtotime("-1 month", $time));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gIHX6
function name:  (null)
number of ops:  25
compiled vars:  !0 = $time, !1 = $final
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'strtotime'
          1        INIT_FCALL                                               'date'
          2        SEND_VAL                                                 'Y-m'
          3        DO_ICALL                                         $2      
          4        CONCAT                                           ~3      $2, '-01'
          5        SEND_VAL                                                 ~3
          6        DO_ICALL                                         $4      
          7        ASSIGN                                                   !0, $4
    3     8        INIT_FCALL                                               'date'
          9        SEND_VAL                                                 'Y-m-d'
         10        SEND_VAR                                                 !0
         11        DO_ICALL                                         $6      
         12        ECHO                                                     $6
    4    13        INIT_FCALL                                               'date'
         14        SEND_VAL                                                 'Y-m-d'
         15        INIT_FCALL                                               'strtotime'
         16        SEND_VAL                                                 '-1+month'
         17        SEND_VAR                                                 !0
         18        DO_ICALL                                         $7      
         19        SEND_VAR                                                 $7
         20        DO_ICALL                                         $8      
         21        ASSIGN                                           ~9      !1, $8
         22        CONCAT                                           ~10     '%3Cbr%3E', ~9
         23        ECHO                                                     ~10
         24      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.93 ms | 1395 KiB | 17 Q