3v4l.org

run code in 300+ PHP versions simultaneously
<?php // your first date coming from a mysql database (date fields) $dateA = date('Y-m-d H:i:s'); // 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 = 14, Position 2 = 16
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FR8na
function name:  (null)
number of ops:  18
compiled vars:  !0 = $dateA, !1 = $dateB, !2 = $timediff
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'date'
          1        SEND_VAL                                                 'Y-m-d+H%3Ai%3As'
          2        DO_ICALL                                         $3      
          3        ASSIGN                                                   !0, $3
    5     4        ASSIGN                                                   !1, '2013-11-11+16%3A27%3A21'
    7     5        INIT_FCALL                                               'strtotime'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                         $6      
          8        INIT_FCALL_BY_NAME                                       'DateTime'
          9        DO_FCALL                                      0  $7      
         10        SUB                                              ~8      $6, $7
         11        ASSIGN                                                   !2, ~8
    9    12        IS_SMALLER                                               86400, !2
         13      > JMPZ                                                     ~10, ->16
   10    14    >   ECHO                                                     'more+than+24+hours'
         15      > JMP                                                      ->17
   14    16    >   ECHO                                                     'less+than+24+hours'
   15    17    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.15 ms | 1395 KiB | 17 Q