3v4l.org

run code in 300+ PHP versions simultaneously
<?php date_default_timezone_set('Europe/Warsaw'); $timezoneShift = (2 * 60 * 60); //+2000 $timestamp = time(); $threeHours = (3 * 60 * 60); //3 hours interval $timezone -= $timezoneShift; $timestamp += $threeHours; $reminder = $timestamp % $threeHours; $timestamp -= $reminder; $timestamp += $timezoneShift; echo date('Y-m-d H:i:s', time()); echo date('Y-m-d H:i:s', $timestamp);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/APnXD
function name:  (null)
number of ops:  27
compiled vars:  !0 = $timezoneShift, !1 = $timestamp, !2 = $threeHours, !3 = $timezone, !4 = $reminder
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'date_default_timezone_set'
          1        SEND_VAL                                                 'Europe%2FWarsaw'
          2        DO_ICALL                                                 
    4     3        ASSIGN                                                   !0, 7200
    6     4        INIT_FCALL                                               'time'
          5        DO_ICALL                                         $7      
          6        ASSIGN                                                   !1, $7
    7     7        ASSIGN                                                   !2, 10800
    9     8        ASSIGN_OP                                     2          !3, !0
   11     9        ASSIGN_OP                                     1          !1, !2
   12    10        MOD                                              ~12     !1, !2
         11        ASSIGN                                                   !4, ~12
   13    12        ASSIGN_OP                                     2          !1, !4
   15    13        ASSIGN_OP                                     1          !1, !0
   17    14        INIT_FCALL                                               'date'
         15        SEND_VAL                                                 'Y-m-d+H%3Ai%3As'
         16        INIT_FCALL                                               'time'
         17        DO_ICALL                                         $16     
         18        SEND_VAR                                                 $16
         19        DO_ICALL                                         $17     
         20        ECHO                                                     $17
   18    21        INIT_FCALL                                               'date'
         22        SEND_VAL                                                 'Y-m-d+H%3Ai%3As'
         23        SEND_VAR                                                 !1
         24        DO_ICALL                                         $18     
         25        ECHO                                                     $18
         26      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.57 ms | 1395 KiB | 19 Q