3v4l.org

run code in 300+ PHP versions simultaneously
<?php $date = date("Y-m-d"); $firstday = date("Y-m-01",strtotime($date)); //取得指定时间所属月的最后一天 $lastday = date("Y-m-d",strtotime("$firstday +1 month -1 day")); echo $lastday ;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HPFaq
function name:  (null)
number of ops:  24
compiled vars:  !0 = $date, !1 = $firstday, !2 = $lastday
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'date'
          1        SEND_VAL                                                 'Y-m-d'
          2        DO_ICALL                                         $3      
          3        ASSIGN                                                   !0, $3
    3     4        INIT_FCALL                                               'date'
          5        SEND_VAL                                                 'Y-m-01'
          6        INIT_FCALL                                               'strtotime'
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                         $5      
          9        SEND_VAR                                                 $5
         10        DO_ICALL                                         $6      
         11        ASSIGN                                                   !1, $6
    5    12        INIT_FCALL                                               'date'
         13        SEND_VAL                                                 'Y-m-d'
         14        INIT_FCALL                                               'strtotime'
         15        NOP                                                      
         16        FAST_CONCAT                                      ~8      !1, '+%2B1+month+-1+day'
         17        SEND_VAL                                                 ~8
         18        DO_ICALL                                         $9      
         19        SEND_VAR                                                 $9
         20        DO_ICALL                                         $10     
         21        ASSIGN                                                   !2, $10
    7    22        ECHO                                                     !2
         23      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.01 ms | 1395 KiB | 17 Q