3v4l.org

run code in 300+ PHP versions simultaneously
<?php $tz = new DateTimeZone("Europe/Zurich"); $dt1 = new Datetime('2019-01-01', $tz); $dt2 = new Datetime('2019-05-01', $tz); echo 'EU/ZU : ' . $dt1->diff($dt2)->format('%a') . ' Days' . PHP_EOL; echo 'EU/ZU : ' . $dt1->diff($dt2)->format('%m') . ' Months' . PHP_EOL . PHP_EOL; $tz = new DateTimeZone("UTC"); $dt1 = new Datetime('2019-01-01', $tz); $dt2 = new Datetime('2019-05-01', $tz); echo 'UTC : ' . $dt1->diff($dt2)->format('%a') . ' Days' . PHP_EOL; echo 'UTC : ' . $dt1->diff($dt2)->format('%m') . ' Months' . PHP_EOL;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/31Be9
function name:  (null)
number of ops:  70
compiled vars:  !0 = $tz, !1 = $dt1, !2 = $dt2
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   3     0  E >   NEW                                              $3      :135
         1        SEND_VAL_EX                                              'Europe%2FZurich'
         2        DO_FCALL                                      0          
         3        ASSIGN                                                   !0, $3
   4     4        NEW                                              $6      :130
         5        SEND_VAL_EX                                              '2019-01-01'
         6        SEND_VAR_EX                                              !0
         7        DO_FCALL                                      0          
         8        ASSIGN                                                   !1, $6
   5     9        NEW                                              $9      :123
        10        SEND_VAL_EX                                              '2019-05-01'
        11        SEND_VAR_EX                                              !0
        12        DO_FCALL                                      0          
        13        ASSIGN                                                   !2, $9
   6    14        INIT_METHOD_CALL                                         !1, 'diff'
        15        SEND_VAR_EX                                              !2
        16        DO_FCALL                                      0  $12     
        17        INIT_METHOD_CALL                                         $12, 'format'
        18        SEND_VAL_EX                                              '%25a'
        19        DO_FCALL                                      0  $13     
        20        CONCAT                                           ~14     'EU%2FZU+%3A+', $13
        21        CONCAT                                           ~15     ~14, '+Days'
        22        CONCAT                                           ~16     ~15, '%0A'
        23        ECHO                                                     ~16
   7    24        INIT_METHOD_CALL                                         !1, 'diff'
        25        SEND_VAR_EX                                              !2
        26        DO_FCALL                                      0  $17     
        27        INIT_METHOD_CALL                                         $17, 'format'
        28        SEND_VAL_EX                                              '%25m'
        29        DO_FCALL                                      0  $18     
        30        CONCAT                                           ~19     'EU%2FZU+%3A+', $18
        31        CONCAT                                           ~20     ~19, '+Months'
        32        CONCAT                                           ~21     ~20, '%0A'
        33        CONCAT                                           ~22     ~21, '%0A'
        34        ECHO                                                     ~22
  10    35        NEW                                              $23     :91
        36        SEND_VAL_EX                                              'UTC'
        37        DO_FCALL                                      0          
        38        ASSIGN                                                   !0, $23
  11    39        NEW                                              $26     :86
        40        SEND_VAL_EX                                              '2019-01-01'
        41        SEND_VAR_EX                                              !0
        42        DO_FCALL                                      0          
        43        ASSIGN                                                   !1, $26
  12    44        NEW                                              $29     :79
        45        SEND_VAL_EX                                              '2019-05-01'
        46        SEND_VAR_EX                                              !0
        47        DO_FCALL                                      0          
        48        ASSIGN                                                   !2, $29
  13    49        INIT_METHOD_CALL                                         !1, 'diff'
        50        SEND_VAR_EX                                              !2
        51        DO_FCALL                                      0  $32     
        52        INIT_METHOD_CALL                                         $32, 'format'
        53        SEND_VAL_EX                                              '%25a'
        54        DO_FCALL                                      0  $33     
        55        CONCAT                                           ~34     'UTC+%3A+', $33
        56        CONCAT                                           ~35     ~34, '+Days'
        57        CONCAT                                           ~36     ~35, '%0A'
        58        ECHO                                                     ~36
  14    59        INIT_METHOD_CALL                                         !1, 'diff'
        60        SEND_VAR_EX                                              !2
        61        DO_FCALL                                      0  $37     
        62        INIT_METHOD_CALL                                         $37, 'format'
        63        SEND_VAL_EX                                              '%25m'
        64        DO_FCALL                                      0  $38     
        65        CONCAT                                           ~39     'UTC+%3A+', $38
        66        CONCAT                                           ~40     ~39, '+Months'
        67        CONCAT                                           ~41     ~40, '%0A'
        68        ECHO                                                     ~41
  15    69      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 7.4.0