3v4l.org

run code in 300+ PHP versions simultaneously
<?php $end_date = "2014-10-09 15:03:10"; $now = "2014-10-09 15:01:10"; $diff = strtotime($now) - strtotime($end_date); $fullDays = floor($diff/(60*60*24)); $fullHours = floor(($diff-($fullDays*60*60*24))/(60*60)); $fullMinutes = floor(($diff-($fullDays*60*60*24)-($fullHours*60*60))/60); echo "Difference is $fullDays days, $fullHours hours and $fullMinutes minutes.";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cWrrM
function name:  (null)
number of ops:  45
compiled vars:  !0 = $end_date, !1 = $now, !2 = $diff, !3 = $fullDays, !4 = $fullHours, !5 = $fullMinutes
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '2014-10-09+15%3A03%3A10'
    3     1        ASSIGN                                                   !1, '2014-10-09+15%3A01%3A10'
    5     2        INIT_FCALL                                               'strtotime'
          3        SEND_VAR                                                 !1
          4        DO_ICALL                                         $8      
          5        INIT_FCALL                                               'strtotime'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                         $9      
          8        SUB                                              ~10     $8, $9
          9        ASSIGN                                                   !2, ~10
    6    10        INIT_FCALL                                               'floor'
         11        DIV                                              ~12     !2, 86400
         12        SEND_VAL                                                 ~12
         13        DO_ICALL                                         $13     
         14        ASSIGN                                                   !3, $13
    7    15        INIT_FCALL                                               'floor'
         16        MUL                                              ~15     !3, 60
         17        MUL                                              ~16     ~15, 60
         18        MUL                                              ~17     ~16, 24
         19        SUB                                              ~18     !2, ~17
         20        DIV                                              ~19     ~18, 3600
         21        SEND_VAL                                                 ~19
         22        DO_ICALL                                         $20     
         23        ASSIGN                                                   !4, $20
    8    24        INIT_FCALL                                               'floor'
         25        MUL                                              ~22     !3, 60
         26        MUL                                              ~23     ~22, 60
         27        MUL                                              ~24     ~23, 24
         28        SUB                                              ~25     !2, ~24
         29        MUL                                              ~26     !4, 60
         30        MUL                                              ~27     ~26, 60
         31        SUB                                              ~28     ~25, ~27
         32        DIV                                              ~29     ~28, 60
         33        SEND_VAL                                                 ~29
         34        DO_ICALL                                         $30     
         35        ASSIGN                                                   !5, $30
    9    36        ROPE_INIT                                     7  ~33     'Difference+is+'
         37        ROPE_ADD                                      1  ~33     ~33, !3
         38        ROPE_ADD                                      2  ~33     ~33, '+days%2C+'
         39        ROPE_ADD                                      3  ~33     ~33, !4
         40        ROPE_ADD                                      4  ~33     ~33, '+hours+and+'
         41        ROPE_ADD                                      5  ~33     ~33, !5
         42        ROPE_END                                      6  ~32     ~33, '+minutes.'
         43        ECHO                                                     ~32
         44      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.17 ms | 1400 KiB | 17 Q