3v4l.org

run code in 300+ PHP versions simultaneously
<?php /*$original = date_default_timezone_set( 'Europe/Berlin'); $WordPress = date_default_timezone_set('UTC'); $tz = timezone_open( 'Asia/Tokyo' ); $date = date_create( '2025-07-30 22:30:00', $tz ); $thisyear = (int) date_format( $date, 'Y' ); $thismonth = (int) date_format( $date, 'm' ); $unixmonth = mktime( 0, 0, 0, $thismonth, 1, $thisyear ); // if set Europe/Berlin 1751320800 (+02:00) $last_day = gmdate( 't', $unixmonth ); var_dump($unixmonth, $thismonth, $last_day, $WordPress);*/ $date = strtotime( '2025-07-31 23:59:59' ); $year = date( 'Y', $date ); $month = date( 'm', $date ); $string = $year . '-' . $month . '-' . '01 00:00:00UTC'; $unixmonth = strtotime( $string ); $last_day = date( 't', $date ); var_dump( $unixmonth, $last_day ); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vHYQo
function name:  (null)
number of ops:  33
compiled vars:  !0 = $date, !1 = $year, !2 = $month, !3 = $string, !4 = $unixmonth, !5 = $last_day
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   INIT_FCALL                                               'strtotime'
          1        SEND_VAL                                                 '2025-07-31+23%3A59%3A59'
          2        DO_ICALL                                         $6      
          3        ASSIGN                                                   !0, $6
   14     4        INIT_FCALL                                               'date'
          5        SEND_VAL                                                 'Y'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                         $8      
          8        ASSIGN                                                   !1, $8
   15     9        INIT_FCALL                                               'date'
         10        SEND_VAL                                                 'm'
         11        SEND_VAR                                                 !0
         12        DO_ICALL                                         $10     
         13        ASSIGN                                                   !2, $10
   16    14        CONCAT                                           ~12     !1, '-'
         15        CONCAT                                           ~13     ~12, !2
         16        CONCAT                                           ~14     ~13, '-'
         17        CONCAT                                           ~15     ~14, '01+00%3A00%3A00UTC'
         18        ASSIGN                                                   !3, ~15
   17    19        INIT_FCALL                                               'strtotime'
         20        SEND_VAR                                                 !3
         21        DO_ICALL                                         $17     
         22        ASSIGN                                                   !4, $17
   18    23        INIT_FCALL                                               'date'
         24        SEND_VAL                                                 't'
         25        SEND_VAR                                                 !0
         26        DO_ICALL                                         $19     
         27        ASSIGN                                                   !5, $19
   19    28        INIT_FCALL                                               'var_dump'
         29        SEND_VAR                                                 !4
         30        SEND_VAR                                                 !5
         31        DO_ICALL                                                 
   20    32      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.26 ms | 1013 KiB | 16 Q