3v4l.org

run code in 300+ PHP versions simultaneously
<?php $dateTimeZoneKolkata = new DateTimeZone('Asia/Kolkata'); $dateTimeUtc = new DateTime('now', new DateTimeZone('UTC')); $offset = $dateTimeZoneKolkata->getOffset($dateTimeUtc); var_dump($offset / 3600);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lMs0l
function name:  (null)
number of ops:  21
compiled vars:  !0 = $dateTimeZoneKolkata, !1 = $dateTimeUtc, !2 = $offset
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $3      'DateTimeZone'
          1        SEND_VAL_EX                                              'Asia%2FKolkata'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $3
    4     4        NEW                                              $6      'DateTime'
          5        SEND_VAL_EX                                              'now'
          6        NEW                                              $7      'DateTimeZone'
          7        SEND_VAL_EX                                              'UTC'
          8        DO_FCALL                                      0          
          9        SEND_VAR_NO_REF_EX                                       $7
         10        DO_FCALL                                      0          
         11        ASSIGN                                                   !1, $6
    5    12        INIT_METHOD_CALL                                         !0, 'getOffset'
         13        SEND_VAR_EX                                              !1
         14        DO_FCALL                                      0  $11     
         15        ASSIGN                                                   !2, $11
    6    16        INIT_FCALL                                               'var_dump'
         17        DIV                                              ~13     !2, 3600
         18        SEND_VAL                                                 ~13
         19        DO_ICALL                                                 
         20      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.29 ms | 1010 KiB | 14 Q