3v4l.org

run code in 300+ PHP versions simultaneously
<?php $then = '2005-09-01 09:02:23'; $then = new DateTime($then); $now = new DateTime(); echo $now; $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>';
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/prYXX
function name:  (null)
number of ops:  29
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
    6     8        ECHO                                                     !1
    7     9        INIT_METHOD_CALL                                         !0, 'diff'
         10        SEND_VAR_EX                                              !1
         11        DO_FCALL                                      0  $10     
         12        ASSIGN                                                   !2, $10
   10    13        FETCH_OBJ_R                                      ~12     !2, 'y'
         14        CONCAT                                           ~13     ~12, '+years+have+passed.%3Cbr%3E'
         15        ECHO                                                     ~13
   11    16        FETCH_OBJ_R                                      ~14     !2, 'm'
         17        CONCAT                                           ~15     ~14, '+months+have+passed.%3Cbr%3E'
         18        ECHO                                                     ~15
   12    19        FETCH_OBJ_R                                      ~16     !2, 'd'
         20        CONCAT                                           ~17     ~16, '+days+have+passed.%3Cbr%3E'
         21        ECHO                                                     ~17
   13    22        FETCH_OBJ_R                                      ~18     !2, 'h'
         23        CONCAT                                           ~19     ~18, '+hours+have+passed.%3Cbr%3E'
         24        ECHO                                                     ~19
   14    25        FETCH_OBJ_R                                      ~20     !2, 'i'
         26        CONCAT                                           ~21     ~20, '+minutes+have+passed.%3Cbr%3E'
         27        ECHO                                                     ~21
         28      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.9 ms | 1385 KiB | 13 Q