3v4l.org

run code in 300+ PHP versions simultaneously
<?php $now = new DateTime(); foreach (DateTimeZone::listIdentifiers() as $tz) { $offset = (new DateTimeZone($tz))->getOffset($now) / 3600; // hours if ($offset == 5) { echo $tz, "\n"; } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 6, Position 2 = 20
Branch analysis from position: 6
2 jumps found. (Code = 78) Position 1 = 7, Position 2 = 20
Branch analysis from position: 7
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 19
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
Branch analysis from position: 19
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
filename:       /in/MTfj6
function name:  (null)
number of ops:  22
compiled vars:  !0 = $now, !1 = $tz, !2 = $offset
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $3      'DateTime'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $3
    5     3        INIT_STATIC_METHOD_CALL                                  'DateTimeZone', 'listIdentifiers'
          4        DO_FCALL                                      0  $6      
          5      > FE_RESET_R                                       $7      $6, ->20
          6    > > FE_FETCH_R                                               $7, !1, ->20
    6     7    >   NEW                                              $8      'DateTimeZone'
          8        SEND_VAR_EX                                              !1
          9        DO_FCALL                                      0          
         10        INIT_METHOD_CALL                                         $8, 'getOffset'
         11        SEND_VAR_EX                                              !0
         12        DO_FCALL                                      0  $10     
         13        DIV                                              ~11     $10, 3600
         14        ASSIGN                                                   !2, ~11
    8    15        IS_EQUAL                                                 !2, 5
         16      > JMPZ                                                     ~13, ->19
    9    17    >   ECHO                                                     !1
         18        ECHO                                                     '%0A'
    5    19    > > JMP                                                      ->6
         20    >   FE_FREE                                                  $7
   11    21      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
240.64 ms | 1394 KiB | 13 Q