3v4l.org

run code in 300+ PHP versions simultaneously
<?php $zones = ['EDT', 'EST']; foreach ($zones as $zone) { // get offset $timezone = new DateTimeZone($zone); $offset = $timezone->getOffset(new DateTime(null, $timezone)); printf("%s (%s) %s\n", $zone, $timezone->getName(), format_offset($offset)); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 27
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 27
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 27
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 27
filename:       /in/2mC3L
function name:  (null)
number of ops:  29
compiled vars:  !0 = $zones, !1 = $zone, !2 = $timezone, !3 = $offset
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    4     1      > FE_RESET_R                                       $5      !0, ->27
          2    > > FE_FETCH_R                                               $5, !1, ->27
    6     3    >   NEW                                              $6      'DateTimeZone'
          4        SEND_VAR_EX                                              !1
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !2, $6
    7     7        INIT_METHOD_CALL                                         !2, 'getOffset'
          8        NEW                                              $9      'DateTime'
          9        SEND_VAL_EX                                              null
         10        SEND_VAR_EX                                              !2
         11        DO_FCALL                                      0          
         12        SEND_VAR_NO_REF_EX                                       $9
         13        DO_FCALL                                      0  $11     
         14        ASSIGN                                                   !3, $11
    9    15        INIT_FCALL                                               'printf'
         16        SEND_VAL                                                 '%25s+%28%25s%29+%25s%0A'
         17        SEND_VAR                                                 !1
         18        INIT_METHOD_CALL                                         !2, 'getName'
         19        DO_FCALL                                      0  $13     
         20        SEND_VAR                                                 $13
         21        INIT_FCALL_BY_NAME                                       'format_offset'
         22        SEND_VAR_EX                                              !3
         23        DO_FCALL                                      0  $14     
         24        SEND_VAR                                                 $14
         25        DO_ICALL                                                 
    4    26      > JMP                                                      ->2
         27    >   FE_FREE                                                  $5
   10    28      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.07 ms | 1396 KiB | 15 Q