3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $datetime1 = time(); $datetime2 = new DateTime('2013-01-16 20:13:00'); $interval = $datetime1->diff($datetime2); $elapsed = $interval->format('%y years, %m months, %a days, %h hours, %i minutes, %S seconds'); $elapsed = str_replace(array('0 years,', ' 0 months,', ' 0 days,', ' 0 hours,', ' 0 minutes,'), '', $elapsed); $elapsed = str_replace(array('1 years, ', ' 1 months, ', ' 1 days, ', ' 1 hours, ', ' 1 minutes'), array('1 year, ', '1 month, ', ' 1 day, ', ' 1 hour, ', ' 1 minute'), $elapsed); echo $elapsed;
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename:       /in/QYLDQ
function name:  (null)
number of ops:  29
compiled vars:  !0 = $datetime1, !1 = $datetime2, !2 = $interval, !3 = $elapsed
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   2     0  E >   INIT_FCALL                                               'time'
         1        DO_ICALL                                         $4      
         2        ASSIGN                                                   !0, $4
   3     3        NEW                                              $6      :-5
         4        SEND_VAL_EX                                              '2013-01-16+20%3A13%3A00'
         5        DO_FCALL                                      0          
         6        ASSIGN                                                   !1, $6
   4     7        INIT_METHOD_CALL                                         !0, 'diff'
         8        SEND_VAR_EX                                              !1
         9        DO_FCALL                                      0  $9      
        10        ASSIGN                                                   !2, $9
   5    11        INIT_METHOD_CALL                                         !2, 'format'
        12        SEND_VAL_EX                                              '%25y+years%2C+%25m+months%2C+%25a+days%2C+%25h+hours%2C+%25i+minutes%2C+%25S+seconds'
        13        DO_FCALL                                      0  $11     
        14        ASSIGN                                                   !3, $11
   6    15        INIT_FCALL                                               'str_replace'
        16        SEND_VAL                                                 <array>
        17        SEND_VAL                                                 ''
        18        SEND_VAR                                                 !3
        19        DO_ICALL                                         $13     
        20        ASSIGN                                                   !3, $13
   7    21        INIT_FCALL                                               'str_replace'
        22        SEND_VAL                                                 <array>
        23        SEND_VAL                                                 <array>
        24        SEND_VAR                                                 !3
        25        DO_ICALL                                         $15     
        26        ASSIGN                                                   !3, $15
   8    27        ECHO                                                     !3
        28      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 7.2.0