3v4l.org

run code in 500+ PHP versions simultaneously
<?php $winter = new DateTime('2012-12-21', new DateTimeZone('Europe/Moscow')); $summer = new DateTime('2012-04-21', new DateTimeZone('Europe/Moscow')); $tz['winter']= ($winter->getOffset())/60/60; $tz['summer']= ($summer->getOffset())/60/60; $tz['diff']=$tz['summer']-$tz['winter']; echo $tz['diff'];
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HHeKk
function name:  (null)
number of ops:  36
compiled vars:  !0 = $winter, !1 = $summer, !2 = $tz
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   NEW                                                  $3      'DateTime'
          1        SEND_VAL_EX                                                  '2012-12-21'
          2        NEW                                                  $4      'DateTimeZone'
          3        SEND_VAL_EX                                                  'Europe%2FMoscow'
          4        DO_FCALL                                          0          
          5        SEND_VAR_NO_REF_EX                                           $4
          6        DO_FCALL                                          0          
          7        ASSIGN                                                       !0, $3
    4     8        NEW                                                  $8      'DateTime'
          9        SEND_VAL_EX                                                  '2012-04-21'
         10        NEW                                                  $9      'DateTimeZone'
         11        SEND_VAL_EX                                                  'Europe%2FMoscow'
         12        DO_FCALL                                          0          
         13        SEND_VAR_NO_REF_EX                                           $9
         14        DO_FCALL                                          0          
         15        ASSIGN                                                       !1, $8
    6    16        INIT_METHOD_CALL                                             !0, 'getOffset'
         17        DO_FCALL                                          0  $14     
         18        DIV                                                  ~15     $14, 60
         19        DIV                                                  ~16     ~15, 60
         20        ASSIGN_DIM                                                   !2, 'winter'
         21        OP_DATA                                                      ~16
    7    22        INIT_METHOD_CALL                                             !1, 'getOffset'
         23        DO_FCALL                                          0  $18     
         24        DIV                                                  ~19     $18, 60
         25        DIV                                                  ~20     ~19, 60
         26        ASSIGN_DIM                                                   !2, 'summer'
         27        OP_DATA                                                      ~20
    8    28        FETCH_DIM_R                                          ~22     !2, 'summer'
         29        FETCH_DIM_R                                          ~23     !2, 'winter'
         30        SUB                                                  ~24     ~22, ~23
         31        ASSIGN_DIM                                                   !2, 'diff'
         32        OP_DATA                                                      ~24
    9    33        FETCH_DIM_R                                          ~25     !2, 'diff'
         34        ECHO                                                         ~25
         35      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
161.01 ms | 2869 KiB | 13 Q