3v4l.org

run code in 300+ PHP versions simultaneously
<?php $start= "2018-05-17 05:04:34"; $end = "2018-05-17 17:04:34"; //Note that it's intentionally reversed $diff = strtotime(substr($start,11))-strtotime(substr($end,11)); //If the calculation was reversed add one day in seconds if($diff <0) $diff += 86400; If($diff >3600){ Echo "more than one hour"; }Else{ Echo "less than one hour"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 20, Position 2 = 21
Branch analysis from position: 20
2 jumps found. (Code = 43) Position 1 = 23, Position 2 = 25
Branch analysis from position: 23
1 jumps found. (Code = 42) Position 1 = 26
Branch analysis from position: 26
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
filename:       /in/g1jZH
function name:  (null)
number of ops:  27
compiled vars:  !0 = $start, !1 = $end, !2 = $diff
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '2018-05-17+05%3A04%3A34'
    4     1        ASSIGN                                                   !1, '2018-05-17+17%3A04%3A34'
    7     2        INIT_FCALL                                               'strtotime'
          3        INIT_FCALL                                               'substr'
          4        SEND_VAR                                                 !0
          5        SEND_VAL                                                 11
          6        DO_ICALL                                         $5      
          7        SEND_VAR                                                 $5
          8        DO_ICALL                                         $6      
          9        INIT_FCALL                                               'strtotime'
         10        INIT_FCALL                                               'substr'
         11        SEND_VAR                                                 !1
         12        SEND_VAL                                                 11
         13        DO_ICALL                                         $7      
         14        SEND_VAR                                                 $7
         15        DO_ICALL                                         $8      
         16        SUB                                              ~9      $6, $8
         17        ASSIGN                                                   !2, ~9
   10    18        IS_SMALLER                                               !2, 0
         19      > JMPZ                                                     ~11, ->21
         20    >   ASSIGN_OP                                     1          !2, 86400
   12    21    >   IS_SMALLER                                               3600, !2
         22      > JMPZ                                                     ~13, ->25
   13    23    >   ECHO                                                     'more+than+one+hour'
   12    24      > JMP                                                      ->26
   15    25    >   ECHO                                                     'less+than+one+hour'
   16    26    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.18 ms | 1012 KiB | 15 Q