3v4l.org

run code in 300+ PHP versions simultaneously
<?php date_default_timezone_set('US/Eastern'); $foo = new DateTime(); $bar = new DateTime(date('Y-m-d H:i:s -01:00', time())); $diff = $bar->diff($foo, false); print_r($foo); print_r($bar); print_r($diff);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GSA0u
function name:  (null)
number of ops:  31
compiled vars:  !0 = $foo, !1 = $bar, !2 = $diff
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'date_default_timezone_set'
          1        SEND_VAL                                                 'US%2FEastern'
          2        DO_ICALL                                                 
    4     3        NEW                                              $4      'DateTime'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !0, $4
    5     6        NEW                                              $7      'DateTime'
          7        INIT_FCALL                                               'date'
          8        SEND_VAL                                                 'Y-m-d+H%3Ai%3As+-01%3A00'
          9        INIT_FCALL                                               'time'
         10        DO_ICALL                                         $8      
         11        SEND_VAR                                                 $8
         12        DO_ICALL                                         $9      
         13        SEND_VAR_NO_REF_EX                                       $9
         14        DO_FCALL                                      0          
         15        ASSIGN                                                   !1, $7
    6    16        INIT_METHOD_CALL                                         !1, 'diff'
         17        SEND_VAR_EX                                              !0
         18        SEND_VAL_EX                                              <false>
         19        DO_FCALL                                      0  $12     
         20        ASSIGN                                                   !2, $12
    7    21        INIT_FCALL                                               'print_r'
         22        SEND_VAR                                                 !0
         23        DO_ICALL                                                 
    8    24        INIT_FCALL                                               'print_r'
         25        SEND_VAR                                                 !1
         26        DO_ICALL                                                 
    9    27        INIT_FCALL                                               'print_r'
         28        SEND_VAR                                                 !2
         29        DO_ICALL                                                 
         30      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
134.24 ms | 1400 KiB | 21 Q