3v4l.org

run code in 300+ PHP versions simultaneously
<?php // your first date coming from a mysql database (date fields) $dateA = '2013-11-11 23:10:30'; // your second date coming from a mysql database (date fields) $dateB = '2013-11-11 16:27:21'; $timediff = strtotime($dateA) - DateTime(); if($timediff > 86400){ echo 'more than 24 hours'; } else { echo 'less than 24 hours'; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 13
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LDEVs
function name:  (null)
number of ops:  15
compiled vars:  !0 = $dateA, !1 = $dateB, !2 = $timediff
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '2013-11-11+23%3A10%3A30'
    5     1        ASSIGN                                                   !1, '2013-11-11+16%3A27%3A21'
    7     2        INIT_FCALL                                               'strtotime'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $5      
          5        INIT_FCALL_BY_NAME                                       'DateTime'
          6        DO_FCALL                                      0  $6      
          7        SUB                                              ~7      $5, $6
          8        ASSIGN                                                   !2, ~7
    9     9        IS_SMALLER                                               86400, !2
         10      > JMPZ                                                     ~9, ->13
   10    11    >   ECHO                                                     'more+than+24+hours'
         12      > JMP                                                      ->14
   14    13    >   ECHO                                                     'less+than+24+hours'
   15    14    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.3 ms | 1386 KiB | 15 Q