3v4l.org

run code in 300+ PHP versions simultaneously
<?php function timezone_list() { static $timezones = null; if ($timezones === null) { $timezones = array(); $offsets = array(); $now = new DateTime(); foreach (DateTimeZone::listIdentifiers() as $timezone) { $now->setTimezone(new DateTimeZone($timezone)); $offsets[] = $offset = $now->getOffset(); $timezones[$timezone] = '(GMT ' . ($offset ? sprintf('%+03d:%02d', intval($offset / 3600), abs(intval($offset % 3600 / 60))) : '') . ') ' . str_replace(array("/", "_", "St "), array(", ", " ", "St. "), $timezone); } array_multisort($offsets, $timezones); } return $timezones; } print_r(timezone_list());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/A4TcN
function name:  (null)
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   INIT_FCALL                                               'print_r'
          1        INIT_FCALL                                               'timezone_list'
          2        DO_FCALL                                      0  $0      
          3        SEND_VAR                                                 $0
          4        DO_ICALL                                                 
          5      > RETURN                                                   1

Function timezone_list:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 56
Branch analysis from position: 3
2 jumps found. (Code = 77) Position 1 = 11, Position 2 = 51
Branch analysis from position: 11
2 jumps found. (Code = 78) Position 1 = 12, Position 2 = 51
Branch analysis from position: 12
2 jumps found. (Code = 43) Position 1 = 24, Position 2 = 39
Branch analysis from position: 24
1 jumps found. (Code = 42) Position 1 = 40
Branch analysis from position: 40
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
Branch analysis from position: 39
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
Branch analysis from position: 51
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 51
Branch analysis from position: 56
filename:       /in/A4TcN
function name:  timezone_list
number of ops:  58
compiled vars:  !0 = $timezones, !1 = $offsets, !2 = $now, !3 = $timezone, !4 = $offset
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   BIND_STATIC                                              !0
    6     1        TYPE_CHECK                                    2          !0
          2      > JMPZ                                                     ~5, ->56
    7     3    >   ASSIGN                                                   !0, <array>
    8     4        ASSIGN                                                   !1, <array>
    9     5        NEW                                              $8      'DateTime'
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !2, $8
   10     8        INIT_STATIC_METHOD_CALL                                  'DateTimeZone', 'listIdentifiers'
          9        DO_FCALL                                      0  $11     
         10      > FE_RESET_R                                       $12     $11, ->51
         11    > > FE_FETCH_R                                               $12, !3, ->51
   11    12    >   INIT_METHOD_CALL                                         !2, 'setTimezone'
         13        NEW                                              $13     'DateTimeZone'
         14        SEND_VAR_EX                                              !3
         15        DO_FCALL                                      0          
         16        SEND_VAR_NO_REF_EX                                       $13
         17        DO_FCALL                                      0          
   12    18        INIT_METHOD_CALL                                         !2, 'getOffset'
         19        DO_FCALL                                      0  $17     
         20        ASSIGN                                           ~18     !4, $17
         21        ASSIGN_DIM                                               !1
         22        OP_DATA                                                  ~18
   13    23      > JMPZ                                                     !4, ->39
         24    >   INIT_FCALL                                               'sprintf'
         25        SEND_VAL                                                 '%25%2B03d%3A%2502d'
         26        DIV                                              ~20     !4, 3600
         27        CAST                                          4  ~21     ~20
         28        SEND_VAL                                                 ~21
         29        INIT_FCALL                                               'abs'
         30        MOD                                              ~22     !4, 3600
         31        DIV                                              ~23     ~22, 60
         32        CAST                                          4  ~24     ~23
         33        SEND_VAL                                                 ~24
         34        DO_ICALL                                         $25     
         35        SEND_VAR                                                 $25
         36        DO_ICALL                                         $26     
         37        QM_ASSIGN                                        ~27     $26
         38      > JMP                                                      ->40
         39    >   QM_ASSIGN                                        ~27     ''
         40    >   CONCAT                                           ~28     '%28GMT+', ~27
   14    41        CONCAT                                           ~29     ~28, '%29+'
         42        INIT_FCALL                                               'str_replace'
         43        SEND_VAL                                                 <array>
         44        SEND_VAL                                                 <array>
         45        SEND_VAR                                                 !3
         46        DO_ICALL                                         $30     
         47        CONCAT                                           ~31     ~29, $30
   13    48        ASSIGN_DIM                                               !0, !3
   14    49        OP_DATA                                                  ~31
   10    50      > JMP                                                      ->11
         51    >   FE_FREE                                                  $12
   16    52        INIT_FCALL                                               'array_multisort'
         53        SEND_REF                                                 !1
         54        SEND_REF                                                 !0
         55        DO_ICALL                                                 
   18    56    > > RETURN                                                   !0
   19    57*     > RETURN                                                   null

End of function timezone_list

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.82 ms | 1394 KiB | 24 Q