3v4l.org

run code in 500+ PHP versions simultaneously
<?php $time_zones = ['America/Indiana/Indianapolis', 'Atlantic/Reykjavik']; foreach ($time_zones as $tz_name) { $abbrev = DateTimeZone::listAbbreviations(); $abbrev = array_merge( ...array_values( $abbrev ) ); $abbrev = array_filter( $abbrev, function ( $entry ) use ( $tz_name ) { return $entry['timezone_id'] === $tz_name; } ); $does_dst = in_array( true, array_column( $abbrev, 'dst' ), true ); var_dump( $tz_name, $does_dst ); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 33
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 33
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 33
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 33
filename:       /in/qupTB
function name:  (null)
number of ops:  35
compiled vars:  !0 = $time_zones, !1 = $tz_name, !2 = $abbrev, !3 = $does_dst
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
    5     1      > FE_RESET_R                                           $5      !0, ->33
          2    > > FE_FETCH_R                                                   $5, !1, ->33
    6     3    >   INIT_STATIC_METHOD_CALL                                      'DateTimeZone', 'listAbbreviations'
          4        DO_FCALL                                          0  $6      
          5        ASSIGN                                                       !2, $6
    7     6        INIT_FCALL                                                   'array_merge'
          7        INIT_FCALL                                                   'array_values'
          8        SEND_VAR                                                     !2
          9        DO_ICALL                                             $8      
         10        SEND_UNPACK                                                  $8
         11        CHECK_UNDEF_ARGS                                             
         12        DO_ICALL                                             $9      
         13        ASSIGN                                                       !2, $9
    8    14        INIT_FCALL                                                   'array_filter'
         15        SEND_VAR                                                     !2
         16        DECLARE_LAMBDA_FUNCTION                              ~11     [0]
         17        BIND_LEXICAL                                                 ~11, !1
   10    18        SEND_VAL                                                     ~11
    8    19        DO_ICALL                                             $12     
         20        ASSIGN                                                       !2, $12
   11    21        INIT_FCALL                                                   'array_column'
         22        SEND_VAR                                                     !2
         23        SEND_VAL                                                     'dst'
         24        DO_ICALL                                             $14     
         25        FRAMELESS_ICALL_3                in_array            ~15     <true>, $14
         26        OP_DATA                                                      <true>
         27        ASSIGN                                                       !3, ~15
   12    28        INIT_FCALL                                                   'var_dump'
         29        SEND_VAR                                                     !1
         30        SEND_VAR                                                     !3
         31        DO_ICALL                                                     
    5    32      > JMP                                                          ->2
         33    >   FE_FREE                                                      $5
   13    34      > RETURN                                                       1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qupTB
function name:  {closure:/in/qupTB:8}
number of ops:  6
compiled vars:  !0 = $entry, !1 = $tz_name
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    8     0  E >   RECV                                                 !0      
          1        BIND_STATIC                                                  !1
    9     2        FETCH_DIM_R                                          ~2      !0, 'timezone_id'
          3        IS_IDENTICAL                                         ~3      !1, ~2
          4      > RETURN                                                       ~3
   10     5*     > RETURN                                                       null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
173.79 ms | 3356 KiB | 18 Q