3v4l.org

run code in 300+ PHP versions simultaneously
<?php $theTime = time(); // specific date/time we're checking, in epoch seconds. $tz = new DateTimeZone('America/New_York'); $transition = $tz->getTransitions($theTime, $theTime); // only one array should be returned into $transition. Now get the data: $offset = $transition[0]['offset']; $abbr = $transition[0]['abbr']; echo $offset . ' - ' . $abbr;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/uRZ1g
function name:  (null)
number of ops:  22
compiled vars:  !0 = $theTime, !1 = $tz, !2 = $transition, !3 = $offset, !4 = $abbr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   INIT_FCALL                                               'time'
          1        DO_ICALL                                         $5      
          2        ASSIGN                                                   !0, $5
    6     3        NEW                                              $7      'DateTimeZone'
          4        SEND_VAL_EX                                              'America%2FNew_York'
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !1, $7
    7     7        INIT_METHOD_CALL                                         !1, 'getTransitions'
          8        SEND_VAR_EX                                              !0
          9        SEND_VAR_EX                                              !0
         10        DO_FCALL                                      0  $10     
         11        ASSIGN                                                   !2, $10
   10    12        FETCH_DIM_R                                      ~12     !2, 0
         13        FETCH_DIM_R                                      ~13     ~12, 'offset'
         14        ASSIGN                                                   !3, ~13
   11    15        FETCH_DIM_R                                      ~15     !2, 0
         16        FETCH_DIM_R                                      ~16     ~15, 'abbr'
         17        ASSIGN                                                   !4, ~16
   13    18        CONCAT                                           ~18     !3, '+-+'
         19        CONCAT                                           ~19     ~18, !4
         20        ECHO                                                     ~19
         21      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.97 ms | 1395 KiB | 15 Q