3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = new DateTime('2000-01-01'); $b = new DateTime('2010-01-01'); $diff = date_diff($a, $b); echo '$a=', $a->format('Y-m-d H:i:s'), "\n"; echo '$b=', $b->format('Y-m-d H:i:s'), "\n"; var_dump($diff);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/g40os
function name:  (null)
number of ops:  29
compiled vars:  !0 = $a, !1 = $b, !2 = $diff
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $3      'DateTime'
          1        SEND_VAL_EX                                              '2000-01-01'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $3
    4     4        NEW                                              $6      'DateTime'
          5        SEND_VAL_EX                                              '2010-01-01'
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !1, $6
    5     8        INIT_FCALL                                               'date_diff'
          9        SEND_VAR                                                 !0
         10        SEND_VAR                                                 !1
         11        DO_ICALL                                         $9      
         12        ASSIGN                                                   !2, $9
    6    13        ECHO                                                     '%24a%3D'
         14        INIT_METHOD_CALL                                         !0, 'format'
         15        SEND_VAL_EX                                              'Y-m-d+H%3Ai%3As'
         16        DO_FCALL                                      0  $11     
         17        ECHO                                                     $11
         18        ECHO                                                     '%0A'
    7    19        ECHO                                                     '%24b%3D'
         20        INIT_METHOD_CALL                                         !1, 'format'
         21        SEND_VAL_EX                                              'Y-m-d+H%3Ai%3As'
         22        DO_FCALL                                      0  $12     
         23        ECHO                                                     $12
         24        ECHO                                                     '%0A'
    8    25        INIT_FCALL                                               'var_dump'
         26        SEND_VAR                                                 !2
         27        DO_ICALL                                                 
         28      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
188.52 ms | 1001 KiB | 15 Q