3v4l.org

run code in 300+ PHP versions simultaneously
<?php $tzList = array(); $tzList[54] = array('name' => 'Moscow, St. Petersburg, Volgograd', 'tz' => 'Europe/Moscow', 'country' => array('RU')); $timeZoneDataId = array(); $timeZoneDataJs = array(); $timeZonesystemName = array(); $year = date('Y'); foreach ($tzList as $key => $tz) { $temp = array(); try { $dateTimeZone = new DateTimeZone($tz['tz']); $dateTimeWinter = new DateTime($year . "-1-1", $dateTimeZone); $dateTimeSummer = new DateTime($year . "-6-30", $dateTimeZone); $dateNow = new DateTime("now", $dateTimeZone); $temp['n'] = $tz['name']; $temp['n'] = $key; if ($countryName && in_array($countryName, $tz['country'])) { $temp['c'] = 1; } $temp['o'] = $dateTimeZone->getOffset($dateNow) / 3600; $summerOffset = $dateTimeZone->getOffset($dateTimeSummer); $winterOffset = $dateTimeZone->getOffset($dateTimeWinter); $nowOffset = $dateTimeZone->getOffset($dateNow); $timeZoneDataId[$tz['tz']] = $key; $timeZoneDataJs[$summerOffset][$winterOffset][] = $temp; $timeZonesystemName[$key] = $tz['tz']; //add info to tzList $tzList[$key]['offsetNow'] = $nowOffset / 3600; $tzList[$key]['id'] = $key; } catch (Exception $e) { //echo '*' . $tz['tz'] . '*'; } } var_dump($tzList);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 11, Position 2 = 90
Branch analysis from position: 11
2 jumps found. (Code = 78) Position 1 = 12, Position 2 = 90
Branch analysis from position: 12
2 jumps found. (Code = 46) Position 1 = 43, Position 2 = 49
Branch analysis from position: 43
2 jumps found. (Code = 43) Position 1 = 50, Position 2 = 52
Branch analysis from position: 50
1 jumps found. (Code = 42) Position 1 = 89
Branch analysis from position: 89
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
Branch analysis from position: 52
Branch analysis from position: 49
Branch analysis from position: 90
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 90
Found catch point at position: 88
Branch analysis from position: 88
2 jumps found. (Code = 107) Position 1 = 89, Position 2 = -2
Branch analysis from position: 89
filename:       /in/8aNTC
function name:  (null)
number of ops:  95
compiled vars:  !0 = $tzList, !1 = $timeZoneDataId, !2 = $timeZoneDataJs, !3 = $timeZonesystemName, !4 = $year, !5 = $tz, !6 = $key, !7 = $temp, !8 = $dateTimeZone, !9 = $dateTimeWinter, !10 = $dateTimeSummer, !11 = $dateNow, !12 = $countryName, !13 = $summerOffset, !14 = $winterOffset, !15 = $nowOffset, !16 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    3     1        ASSIGN_DIM                                               !0, 54
          2        OP_DATA                                                  <array>
    4     3        ASSIGN                                                   !1, <array>
    5     4        ASSIGN                                                   !2, <array>
    6     5        ASSIGN                                                   !3, <array>
    7     6        INIT_FCALL                                               'date'
          7        SEND_VAL                                                 'Y'
          8        DO_ICALL                                         $22     
          9        ASSIGN                                                   !4, $22
    8    10      > FE_RESET_R                                       $24     !0, ->90
         11    > > FE_FETCH_R                                       ~25     $24, !5, ->90
         12    >   ASSIGN                                                   !6, ~25
   10    13        ASSIGN                                                   !7, <array>
   13    14        NEW                                              $28     'DateTimeZone'
         15        CHECK_FUNC_ARG                                           
         16        FETCH_DIM_FUNC_ARG                               $29     !5, 'tz'
         17        SEND_FUNC_ARG                                            $29
         18        DO_FCALL                                      0          
         19        ASSIGN                                                   !8, $28
   14    20        NEW                                              $32     'DateTime'
         21        CONCAT                                           ~33     !4, '-1-1'
         22        SEND_VAL_EX                                              ~33
         23        SEND_VAR_EX                                              !8
         24        DO_FCALL                                      0          
         25        ASSIGN                                                   !9, $32
   15    26        NEW                                              $36     'DateTime'
         27        CONCAT                                           ~37     !4, '-6-30'
         28        SEND_VAL_EX                                              ~37
         29        SEND_VAR_EX                                              !8
         30        DO_FCALL                                      0          
         31        ASSIGN                                                   !10, $36
   16    32        NEW                                              $40     'DateTime'
         33        SEND_VAL_EX                                              'now'
         34        SEND_VAR_EX                                              !8
         35        DO_FCALL                                      0          
         36        ASSIGN                                                   !11, $40
   17    37        FETCH_DIM_R                                      ~44     !5, 'name'
         38        ASSIGN_DIM                                               !7, 'n'
         39        OP_DATA                                                  ~44
   18    40        ASSIGN_DIM                                               !7, 'n'
         41        OP_DATA                                                  !6
   19    42      > JMPZ_EX                                          ~46     !12, ->49
         43    >   INIT_FCALL                                               'in_array'
         44        SEND_VAR                                                 !12
         45        FETCH_DIM_R                                      ~47     !5, 'country'
         46        SEND_VAL                                                 ~47
         47        DO_ICALL                                         $48     
         48        BOOL                                             ~46     $48
         49    > > JMPZ                                                     ~46, ->52
   21    50    >   ASSIGN_DIM                                               !7, 'c'
         51        OP_DATA                                                  1
   23    52    >   INIT_METHOD_CALL                                         !8, 'getOffset'
         53        SEND_VAR_EX                                              !11
         54        DO_FCALL                                      0  $51     
         55        DIV                                              ~52     $51, 3600
         56        ASSIGN_DIM                                               !7, 'o'
         57        OP_DATA                                                  ~52
   24    58        INIT_METHOD_CALL                                         !8, 'getOffset'
         59        SEND_VAR_EX                                              !10
         60        DO_FCALL                                      0  $53     
         61        ASSIGN                                                   !13, $53
   25    62        INIT_METHOD_CALL                                         !8, 'getOffset'
         63        SEND_VAR_EX                                              !9
         64        DO_FCALL                                      0  $55     
         65        ASSIGN                                                   !14, $55
   26    66        INIT_METHOD_CALL                                         !8, 'getOffset'
         67        SEND_VAR_EX                                              !11
         68        DO_FCALL                                      0  $57     
         69        ASSIGN                                                   !15, $57
   27    70        FETCH_DIM_R                                      ~59     !5, 'tz'
         71        ASSIGN_DIM                                               !1, ~59
         72        OP_DATA                                                  !6
   28    73        FETCH_DIM_W                                      $61     !2, !13
         74        FETCH_DIM_W                                      $62     $61, !14
         75        ASSIGN_DIM                                               $62
         76        OP_DATA                                                  !7
   29    77        FETCH_DIM_R                                      ~65     !5, 'tz'
         78        ASSIGN_DIM                                               !3, !6
         79        OP_DATA                                                  ~65
   32    80        DIV                                              ~68     !15, 3600
         81        FETCH_DIM_W                                      $66     !0, !6
         82        ASSIGN_DIM                                               $66, 'offsetNow'
         83        OP_DATA                                                  ~68
   33    84        FETCH_DIM_W                                      $69     !0, !6
         85        ASSIGN_DIM                                               $69, 'id'
         86        OP_DATA                                                  !6
         87      > JMP                                                      ->89
   34    88  E > > CATCH                                       last         'Exception'
    8    89    > > JMP                                                      ->11
         90    >   FE_FREE                                                  $24
   40    91        INIT_FCALL                                               'var_dump'
         92        SEND_VAR                                                 !0
         93        DO_ICALL                                                 
         94      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.74 ms | 1404 KiB | 19 Q