3v4l.org

run code in 300+ 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 = 36
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 36
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 36
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 36
filename:       /in/qupTB
function name:  (null)
number of ops:  38
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, ->36
          2    > > FE_FETCH_R                                               $5, !1, ->36
    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                                               'in_array'
         22        SEND_VAL                                                 <true>
         23        INIT_FCALL                                               'array_column'
         24        SEND_VAR                                                 !2
         25        SEND_VAL                                                 'dst'
         26        DO_ICALL                                         $14     
         27        SEND_VAR                                                 $14
         28        SEND_VAL                                                 <true>
         29        DO_ICALL                                         $15     
         30        ASSIGN                                                   !3, $15
   12    31        INIT_FCALL                                               'var_dump'
         32        SEND_VAR                                                 !1
         33        SEND_VAR                                                 !3
         34        DO_ICALL                                                 
    5    35      > JMP                                                      ->2
         36    >   FE_FREE                                                  $5
   13    37      > 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}
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.0.0


preferences:
152.91 ms | 1447 KiB | 19 Q