3v4l.org

run code in 500+ PHP versions simultaneously
<?php $localTimezone = new DateTimeZone('America/Sao_Paulo'); $gmtTimezone = new DateTimeZone('GMT'); $currentDateTime = new DateTime('2020-01-21 13:14', $gmtTimezone); $offset = $localTimezone ->getOffset($currentDateTime ); echo $offset/3600;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/39ein
function name:  (null)
number of ops:  20
compiled vars:  !0 = $localTimezone, !1 = $gmtTimezone, !2 = $currentDateTime, !3 = $offset
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   NEW                                                  $4      'DateTimeZone'
          1        SEND_VAL_EX                                                  'America%2FSao_Paulo'
          2        DO_FCALL                                          0          
          3        ASSIGN                                                       !0, $4
    4     4        NEW                                                  $7      'DateTimeZone'
          5        SEND_VAL_EX                                                  'GMT'
          6        DO_FCALL                                          0          
          7        ASSIGN                                                       !1, $7
    5     8        NEW                                                  $10     'DateTime'
          9        SEND_VAL_EX                                                  '2020-01-21+13%3A14'
         10        SEND_VAR_EX                                                  !1
         11        DO_FCALL                                          0          
         12        ASSIGN                                                       !2, $10
    6    13        INIT_METHOD_CALL                                             !0, 'getOffset'
         14        SEND_VAR_EX                                                  !2
         15        DO_FCALL                                          0  $13     
         16        ASSIGN                                                       !3, $13
    7    17        DIV                                                  ~15     !3, 3600
         18        ECHO                                                         ~15
    8    19      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
172.4 ms | 3253 KiB | 13 Q