3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.43 ms | 1404 KiB | 17 Q