3v4l.org

run code in 300+ PHP versions simultaneously
<?php date_default_timezone_set('UTC'); // fill in the blank $timezones = array( 'Sydney' => 'Australia/Sydney', 'Melbourne' => 'Australia/Melbourne', 'New York' => 'America/New_York' ); foreach ($timezones as $name => $timezone) { $localTime = new DateTime('now', new DateTimeZone($timezone)); echo "$name: ", $localTime->format('h:ia'); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 5, Position 2 = 23
Branch analysis from position: 5
2 jumps found. (Code = 78) Position 1 = 6, Position 2 = 23
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 23
filename:       /in/gjjtH
function name:  (null)
number of ops:  25
compiled vars:  !0 = $timezones, !1 = $timezone, !2 = $name, !3 = $localTime
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'date_default_timezone_set'
          1        SEND_VAL                                                 'UTC'
          2        DO_ICALL                                                 
    5     3        ASSIGN                                                   !0, <array>
   11     4      > FE_RESET_R                                       $6      !0, ->23
          5    > > FE_FETCH_R                                       ~7      $6, !1, ->23
          6    >   ASSIGN                                                   !2, ~7
   12     7        NEW                                              $9      'DateTime'
          8        SEND_VAL_EX                                              'now'
          9        NEW                                              $10     'DateTimeZone'
         10        SEND_VAR_EX                                              !1
         11        DO_FCALL                                      0          
         12        SEND_VAR_NO_REF_EX                                       $10
         13        DO_FCALL                                      0          
         14        ASSIGN                                                   !3, $9
   13    15        NOP                                                      
         16        FAST_CONCAT                                      ~14     !2, '%3A+'
         17        ECHO                                                     ~14
         18        INIT_METHOD_CALL                                         !3, 'format'
         19        SEND_VAL_EX                                              'h%3Aia'
         20        DO_FCALL                                      0  $15     
         21        ECHO                                                     $15
   11    22      > JMP                                                      ->5
         23    >   FE_FREE                                                  $6
   14    24      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.55 ms | 1387 KiB | 15 Q