3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getOffset($timezone) { return DateTime::createFromFormat('U',0)->setTimeZone(new DateTimeZone($timezone))->format('Z'); } echo getOffset('America/New_York');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BBalM
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   INIT_FCALL                                               'getoffset'
          1        SEND_VAL                                                 'America%2FNew_York'
          2        DO_FCALL                                      0  $0      
          3        ECHO                                                     $0
          4      > RETURN                                                   1

Function getoffset:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BBalM
function name:  getOffset
number of ops:  16
compiled vars:  !0 = $timezone
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        INIT_STATIC_METHOD_CALL                                  'DateTime', 'createFromFormat'
          2        SEND_VAL                                                 'U'
          3        SEND_VAL                                                 0
          4        DO_FCALL                                      0  $1      
          5        INIT_METHOD_CALL                                         $1, 'setTimeZone'
          6        NEW                                              $2      'DateTimeZone'
          7        SEND_VAR_EX                                              !0
          8        DO_FCALL                                      0          
          9        SEND_VAR_NO_REF_EX                                       $2
         10        DO_FCALL                                      0  $4      
         11        INIT_METHOD_CALL                                         $4, 'format'
         12        SEND_VAL_EX                                              'Z'
         13        DO_FCALL                                      0  $5      
         14      > RETURN                                                   $5
    5    15*     > RETURN                                                   null

End of function getoffset

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.58 ms | 1397 KiB | 14 Q