3v4l.org

run code in 300+ PHP versions simultaneously
<?php $dateTimeZoneTaipei = new DateTimeZone("Asia/Taipei"); $dateTimeZoneJapan = new DateTimeZone("Asia/Tokyo"); // Create two DateTime objects that will contain the same Unix timestamp, but // have different timezones attached to them. $dateTimeTaipei = new DateTime("now", $dateTimeZoneTaipei); $dateTimeJapan = new DateTime("now", $dateTimeZoneJapan); // Calculate the GMT offset for the date/time contained in the $dateTimeTaipei // object, but using the timezone rules as defined for Tokyo // ($dateTimeZoneJapan). $timeOffset = $dateTimeZoneJapan->getOffset($dateTimeTaipei); // Should show int(32400) (for dates after Sat Sep 8 01:00:00 1951 JST). var_dump($timeOffset);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/168fY
function name:  (null)
number of ops:  26
compiled vars:  !0 = $dateTimeZoneTaipei, !1 = $dateTimeZoneJapan, !2 = $dateTimeTaipei, !3 = $dateTimeJapan, !4 = $timeOffset
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $5      'DateTimeZone'
          1        SEND_VAL_EX                                              'Asia%2FTaipei'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $5
    4     4        NEW                                              $8      'DateTimeZone'
          5        SEND_VAL_EX                                              'Asia%2FTokyo'
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !1, $8
    8     8        NEW                                              $11     'DateTime'
          9        SEND_VAL_EX                                              'now'
         10        SEND_VAR_EX                                              !0
         11        DO_FCALL                                      0          
         12        ASSIGN                                                   !2, $11
    9    13        NEW                                              $14     'DateTime'
         14        SEND_VAL_EX                                              'now'
         15        SEND_VAR_EX                                              !1
         16        DO_FCALL                                      0          
         17        ASSIGN                                                   !3, $14
   14    18        INIT_METHOD_CALL                                         !1, 'getOffset'
         19        SEND_VAR_EX                                              !2
         20        DO_FCALL                                      0  $17     
         21        ASSIGN                                                   !4, $17
   17    22        INIT_FCALL                                               'var_dump'
         23        SEND_VAR                                                 !4
         24        DO_ICALL                                                 
         25      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145.98 ms | 1395 KiB | 15 Q