3v4l.org

run code in 300+ PHP versions simultaneously
<?php $dt = new \DateTime('2018-04-01 03:10:00', new \DateTimeZone('Pacific/Auckland')); $dt2 = clone $dt; $dt2->sub(new \DateInterval('PT2H')); var_dump($dt > $dt2, $dt->format(\DateTime::RFC3339), $dt2->format(\DateTime::RFC3339), $dt->diff($dt2)->format('%h'));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/veWsf
function name:  (null)
number of ops:  36
compiled vars:  !0 = $dt, !1 = $dt2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $2      'DateTime'
          1        SEND_VAL_EX                                              '2018-04-01+03%3A10%3A00'
          2        NEW                                              $3      'DateTimeZone'
          3        SEND_VAL_EX                                              'Pacific%2FAuckland'
          4        DO_FCALL                                      0          
          5        SEND_VAR_NO_REF_EX                                       $3
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !0, $2
    5     8        CLONE                                            ~7      !0
          9        ASSIGN                                                   !1, ~7
    6    10        INIT_METHOD_CALL                                         !1, 'sub'
         11        NEW                                              $9      'DateInterval'
         12        SEND_VAL_EX                                              'PT2H'
         13        DO_FCALL                                      0          
         14        SEND_VAR_NO_REF_EX                                       $9
         15        DO_FCALL                                      0          
    8    16        INIT_FCALL                                               'var_dump'
         17        IS_SMALLER                                       ~12     !1, !0
         18        SEND_VAL                                                 ~12
         19        INIT_METHOD_CALL                                         !0, 'format'
         20        SEND_VAL_EX                                              'Y-m-d%5CTH%3Ai%3AsP'
         21        DO_FCALL                                      0  $13     
         22        SEND_VAR                                                 $13
         23        INIT_METHOD_CALL                                         !1, 'format'
         24        SEND_VAL_EX                                              'Y-m-d%5CTH%3Ai%3AsP'
         25        DO_FCALL                                      0  $14     
         26        SEND_VAR                                                 $14
         27        INIT_METHOD_CALL                                         !0, 'diff'
         28        SEND_VAR_EX                                              !1
         29        DO_FCALL                                      0  $15     
         30        INIT_METHOD_CALL                                         $15, 'format'
         31        SEND_VAL_EX                                              '%25h'
         32        DO_FCALL                                      0  $16     
         33        SEND_VAR                                                 $16
         34        DO_ICALL                                                 
         35      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
60.44 ms | 417 KiB | 14 Q