3v4l.org

run code in 300+ PHP versions simultaneously
<?php $start = new DateTime('2014-01-07', new DateTimeZone('UTC')); $end = clone $start; $start->sub(new DateInterval('P1M')); // substract one month echo $start->format('r').' - '.$end->format('r'); print_r($end->diff($start)); print_r($start->diff($end));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4Dd8C
function name:  (null)
number of ops:  38
compiled vars:  !0 = $start, !1 = $end
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $2      'DateTime'
          1        SEND_VAL_EX                                              '2014-01-07'
          2        NEW                                              $3      'DateTimeZone'
          3        SEND_VAL_EX                                              'UTC'
          4        DO_FCALL                                      0          
          5        SEND_VAR_NO_REF_EX                                       $3
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !0, $2
    4     8        CLONE                                            ~7      !0
          9        ASSIGN                                                   !1, ~7
    5    10        INIT_METHOD_CALL                                         !0, 'sub'
         11        NEW                                              $9      'DateInterval'
         12        SEND_VAL_EX                                              'P1M'
         13        DO_FCALL                                      0          
         14        SEND_VAR_NO_REF_EX                                       $9
         15        DO_FCALL                                      0          
    7    16        INIT_METHOD_CALL                                         !0, 'format'
         17        SEND_VAL_EX                                              'r'
         18        DO_FCALL                                      0  $12     
         19        CONCAT                                           ~13     $12, '+-+'
         20        INIT_METHOD_CALL                                         !1, 'format'
         21        SEND_VAL_EX                                              'r'
         22        DO_FCALL                                      0  $14     
         23        CONCAT                                           ~15     ~13, $14
         24        ECHO                                                     ~15
    9    25        INIT_FCALL                                               'print_r'
         26        INIT_METHOD_CALL                                         !1, 'diff'
         27        SEND_VAR_EX                                              !0
         28        DO_FCALL                                      0  $16     
         29        SEND_VAR                                                 $16
         30        DO_ICALL                                                 
   10    31        INIT_FCALL                                               'print_r'
         32        INIT_METHOD_CALL                                         !0, 'diff'
         33        SEND_VAR_EX                                              !1
         34        DO_FCALL                                      0  $18     
         35        SEND_VAR                                                 $18
         36        DO_ICALL                                                 
         37      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.98 ms | 1396 KiB | 15 Q