3v4l.org

run code in 300+ PHP versions simultaneously
<?php function get_timezones() { $o = array(); $t = timezone_identifiers_list(); foreach($t as $a) { $t = ''; //Get the time difference $zone = new DateTimeZone($a); $seconds = $zone->getOffset( new DateTime("now", $zone) ); $hours = sprintf( "%+02d" , intval($seconds/3600)); $minutes = sprintf( "%02d" , ($seconds%3600)/60 ); $t = $a ." [ $hours:$minutes ]" ; $o[$a] = $t; } ksort($o); return $o; } get_timezones();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/7O4Ru
function name:  (null)
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   26     0  E >   INIT_FCALL                                               'get_timezones'
          1        DO_FCALL                                      0          
          2      > RETURN                                                   1

Function get_timezones:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 5, Position 2 = 43
Branch analysis from position: 5
2 jumps found. (Code = 78) Position 1 = 6, Position 2 = 43
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
Branch analysis from position: 43
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 43
filename:       /in/7O4Ru
function name:  get_timezones
number of ops:  49
compiled vars:  !0 = $o, !1 = $t, !2 = $a, !3 = $zone, !4 = $seconds, !5 = $hours, !6 = $minutes
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, <array>
    5     1        INIT_FCALL                                               'timezone_identifiers_list'
          2        DO_ICALL                                         $8      
          3        ASSIGN                                                   !1, $8
    7     4      > FE_RESET_R                                       $10     !1, ->43
          5    > > FE_FETCH_R                                               $10, !2, ->43
    9     6    >   ASSIGN                                                   !1, ''
   12     7        NEW                                              $12     'DateTimeZone'
          8        SEND_VAR_EX                                              !2
          9        DO_FCALL                                      0          
         10        ASSIGN                                                   !3, $12
   13    11        INIT_METHOD_CALL                                         !3, 'getOffset'
         12        NEW                                              $15     'DateTime'
         13        SEND_VAL_EX                                              'now'
         14        SEND_VAR_EX                                              !3
         15        DO_FCALL                                      0          
         16        SEND_VAR_NO_REF_EX                                       $15
         17        DO_FCALL                                      0  $17     
         18        ASSIGN                                                   !4, $17
   14    19        INIT_FCALL                                               'sprintf'
         20        SEND_VAL                                                 '%25%2B02d'
         21        DIV                                              ~19     !4, 3600
         22        CAST                                          4  ~20     ~19
         23        SEND_VAL                                                 ~20
         24        DO_ICALL                                         $21     
         25        ASSIGN                                                   !5, $21
   15    26        INIT_FCALL                                               'sprintf'
         27        SEND_VAL                                                 '%2502d'
         28        MOD                                              ~23     !4, 3600
         29        DIV                                              ~24     ~23, 60
         30        SEND_VAL                                                 ~24
         31        DO_ICALL                                         $25     
         32        ASSIGN                                                   !6, $25
   17    33        ROPE_INIT                                     5  ~28     '++%5B+'
         34        ROPE_ADD                                      1  ~28     ~28, !5
         35        ROPE_ADD                                      2  ~28     ~28, '%3A'
         36        ROPE_ADD                                      3  ~28     ~28, !6
         37        ROPE_END                                      4  ~27     ~28, '+%5D'
         38        CONCAT                                           ~31     !2, ~27
         39        ASSIGN                                                   !1, ~31
   18    40        ASSIGN_DIM                                               !0, !2
         41        OP_DATA                                                  !1
    7    42      > JMP                                                      ->5
         43    >   FE_FREE                                                  $10
   20    44        INIT_FCALL                                               'ksort'
         45        SEND_REF                                                 !0
         46        DO_ICALL                                                 
   22    47      > RETURN                                                   !0
   23    48*     > RETURN                                                   null

End of function get_timezones

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
174.68 ms | 1402 KiB | 20 Q