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) - strtotime($dateB); if($timediff > 86400){ echo '$timediff 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 = 15, Position 2 = 17
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0m5a0
function name:  (null)
number of ops:  19
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                                               'strtotime'
          9        SEND_VAR                                                 !1
         10        DO_ICALL                                         $7      
         11        SUB                                              ~8      $6, $7
         12        ASSIGN                                                   !2, ~8
    9    13        IS_SMALLER                                               86400, !2
         14      > JMPZ                                                     ~10, ->17
   10    15    >   ECHO                                                     '%24timediff+more+than+24+hours'
         16      > JMP                                                      ->18
   14    17    >   ECHO                                                     'less+than+24+hours'
   15    18    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.38 ms | 1386 KiB | 17 Q