3v4l.org

run code in 300+ PHP versions simultaneously
<?php $then = '2005-09-01 09:02:23'; $then = new DateTime($then); $now = new DateTime(); $sinceThen = $then->diff($now); //Combined echo $sinceThen->y.' years have passed.<br>'; echo $sinceThen->m.' months have passed.<br>'; echo $sinceThen->d.' days have passed.<br>'; echo $sinceThen->h.' hours have passed.<br>'; echo $sinceThen->i.' minutes have passed.<br>'; $sinceThen = $then->diff($now);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/J2QpT
function name:  (null)
number of ops:  32
compiled vars:  !0 = $then, !1 = $now, !2 = $sinceThen
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '2005-09-01+09%3A02%3A23'
    3     1        NEW                                              $4      'DateTime'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $4
    5     5        NEW                                              $7      'DateTime'
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !1, $7
    7     8        INIT_METHOD_CALL                                         !0, 'diff'
          9        SEND_VAR_EX                                              !1
         10        DO_FCALL                                      0  $10     
         11        ASSIGN                                                   !2, $10
   10    12        FETCH_OBJ_R                                      ~12     !2, 'y'
         13        CONCAT                                           ~13     ~12, '+years+have+passed.%3Cbr%3E'
         14        ECHO                                                     ~13
   11    15        FETCH_OBJ_R                                      ~14     !2, 'm'
         16        CONCAT                                           ~15     ~14, '+months+have+passed.%3Cbr%3E'
         17        ECHO                                                     ~15
   12    18        FETCH_OBJ_R                                      ~16     !2, 'd'
         19        CONCAT                                           ~17     ~16, '+days+have+passed.%3Cbr%3E'
         20        ECHO                                                     ~17
   13    21        FETCH_OBJ_R                                      ~18     !2, 'h'
         22        CONCAT                                           ~19     ~18, '+hours+have+passed.%3Cbr%3E'
         23        ECHO                                                     ~19
   14    24        FETCH_OBJ_R                                      ~20     !2, 'i'
         25        CONCAT                                           ~21     ~20, '+minutes+have+passed.%3Cbr%3E'
         26        ECHO                                                     ~21
   15    27        INIT_METHOD_CALL                                         !0, 'diff'
         28        SEND_VAR_EX                                              !1
         29        DO_FCALL                                      0  $22     
         30        ASSIGN                                                   !2, $22
         31      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
166.05 ms | 1386 KiB | 13 Q