3v4l.org

run code in 300+ PHP versions simultaneously
<?php $post_timestamp = '2014-03-09 20:46:51-04:00'; $pc_time = '2014-03-09 20:56:00'; $post = new DateTime($post_timestamp); $pc = new DateTime($pc_time); $diff = $post->diff($pc); $years = $diff->y; $months = $diff->m; $days = $diff->d; $hours = $diff->h; $minutes = $diff->i; $seconds = $diff->s; echo sprintf('Time Difference %s years, %s months, %s days, %s hours, %s minutes, %s seconds', $years, $months, $days, $hours, $minutes, $seconds);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/99avr
function name:  (null)
number of ops:  37
compiled vars:  !0 = $post_timestamp, !1 = $pc_time, !2 = $post, !3 = $pc, !4 = $diff, !5 = $years, !6 = $months, !7 = $days, !8 = $hours, !9 = $minutes, !10 = $seconds
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '2014-03-09+20%3A46%3A51-04%3A00'
    3     1        ASSIGN                                                   !1, '2014-03-09+20%3A56%3A00'
    5     2        NEW                                              $13     'DateTime'
          3        SEND_VAR_EX                                              !0
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !2, $13
    6     6        NEW                                              $16     'DateTime'
          7        SEND_VAR_EX                                              !1
          8        DO_FCALL                                      0          
          9        ASSIGN                                                   !3, $16
    8    10        INIT_METHOD_CALL                                         !2, 'diff'
         11        SEND_VAR_EX                                              !3
         12        DO_FCALL                                      0  $19     
         13        ASSIGN                                                   !4, $19
    9    14        FETCH_OBJ_R                                      ~21     !4, 'y'
         15        ASSIGN                                                   !5, ~21
   10    16        FETCH_OBJ_R                                      ~23     !4, 'm'
         17        ASSIGN                                                   !6, ~23
   11    18        FETCH_OBJ_R                                      ~25     !4, 'd'
         19        ASSIGN                                                   !7, ~25
   12    20        FETCH_OBJ_R                                      ~27     !4, 'h'
         21        ASSIGN                                                   !8, ~27
   13    22        FETCH_OBJ_R                                      ~29     !4, 'i'
         23        ASSIGN                                                   !9, ~29
   14    24        FETCH_OBJ_R                                      ~31     !4, 's'
         25        ASSIGN                                                   !10, ~31
   15    26        INIT_FCALL                                               'sprintf'
         27        SEND_VAL                                                 'Time+Difference+%25s+years%2C+%25s+months%2C+%25s+days%2C+%25s+hours%2C+%25s+minutes%2C+%25s+seconds'
         28        SEND_VAR                                                 !5
         29        SEND_VAR                                                 !6
         30        SEND_VAR                                                 !7
         31        SEND_VAR                                                 !8
         32        SEND_VAR                                                 !9
         33        SEND_VAR                                                 !10
         34        DO_ICALL                                         $33     
         35        ECHO                                                     $33
         36      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.16 ms | 1388 KiB | 15 Q