3v4l.org

run code in 300+ PHP versions simultaneously
<?php function tz_offset_to_name($offset) { $offset *= 3600; // convert hour offset to seconds $abbrarray = timezone_abbreviations_list(); foreach ($abbrarray as $abbr) { foreach ($abbr as $city) { if ($city['offset'] == $offset) { return $city['timezone_id']; } } } return FALSE; } echo tz_offset_to_name("+5:00");
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6SpeE
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   INIT_FCALL                                               'tz_offset_to_name'
          1        SEND_VAL                                                 '%2B5%3A00'
          2        DO_FCALL                                      0  $0      
          3        ECHO                                                     $0
          4      > RETURN                                                   1

Function tz_offset_to_name:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 6, Position 2 = 19
Branch analysis from position: 6
2 jumps found. (Code = 78) Position 1 = 7, Position 2 = 19
Branch analysis from position: 7
2 jumps found. (Code = 77) Position 1 = 8, Position 2 = 17
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 17
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 16
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
Branch analysis from position: 17
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
filename:       /in/6SpeE
function name:  tz_offset_to_name
number of ops:  22
compiled vars:  !0 = $offset, !1 = $abbrarray, !2 = $abbr, !3 = $city
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    4     1        ASSIGN_OP                                     3          !0, 3600
    5     2        INIT_FCALL                                               'timezone_abbreviations_list'
          3        DO_ICALL                                         $5      
          4        ASSIGN                                                   !1, $5
    6     5      > FE_RESET_R                                       $7      !1, ->19
          6    > > FE_FETCH_R                                               $7, !2, ->19
    8     7    > > FE_RESET_R                                       $8      !2, ->17
          8    > > FE_FETCH_R                                               $8, !3, ->17
   10     9    >   FETCH_DIM_R                                      ~9      !3, 'offset'
         10        IS_EQUAL                                                 !0, ~9
         11      > JMPZ                                                     ~10, ->16
   12    12    >   FETCH_DIM_R                                      ~11     !3, 'timezone_id'
         13        FE_FREE                                                  $8
         14        FE_FREE                                                  $7
         15      > RETURN                                                   ~11
    8    16    > > JMP                                                      ->8
         17    >   FE_FREE                                                  $8
    6    18      > JMP                                                      ->6
         19    >   FE_FREE                                                  $7
   17    20      > RETURN                                                   <false>
   18    21*     > RETURN                                                   null

End of function tz_offset_to_name

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
176.14 ms | 1399 KiB | 16 Q