3v4l.org

run code in 300+ PHP versions simultaneously
<?php $now = new DateTime('2016-01-10 23:30:59'); $start = new DateTime('saturday this week 15:00'); $end = new DateTime('monday next week 08:00'); $departure = new DateTime('2016-01-11 23:30:59'); $diff = (strtotime($departure->format('Y-m-d H:i:s')) - strtotime($now->format('Y-m-d H:i:s')))/3600; echo $diff . PHP_EOL;; echo $now->format('Y-m-d H:i:s'). PHP_EOL; echo $start->format('Y-m-d H:i:s'). PHP_EOL; echo $end->format('Y-m-d H:i:s'). PHP_EOL; if ($now > $start && $now < $end && $diff <= 72) { echo 'Error! Please contact administrator!'; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 50, Position 2 = 52
Branch analysis from position: 50
2 jumps found. (Code = 46) Position 1 = 53, Position 2 = 55
Branch analysis from position: 53
2 jumps found. (Code = 43) Position 1 = 56, Position 2 = 57
Branch analysis from position: 56
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 57
Branch analysis from position: 55
Branch analysis from position: 52
filename:       /in/BkEAA
function name:  (null)
number of ops:  58
compiled vars:  !0 = $now, !1 = $start, !2 = $end, !3 = $departure, !4 = $diff
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   NEW                                              $5      'DateTime'
          1        SEND_VAL_EX                                              '2016-01-10+23%3A30%3A59'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $5
    3     4        NEW                                              $8      'DateTime'
          5        SEND_VAL_EX                                              'saturday+this+week+15%3A00'
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !1, $8
    4     8        NEW                                              $11     'DateTime'
          9        SEND_VAL_EX                                              'monday+next+week+08%3A00'
         10        DO_FCALL                                      0          
         11        ASSIGN                                                   !2, $11
    5    12        NEW                                              $14     'DateTime'
         13        SEND_VAL_EX                                              '2016-01-11+23%3A30%3A59'
         14        DO_FCALL                                      0          
         15        ASSIGN                                                   !3, $14
    6    16        INIT_FCALL                                               'strtotime'
         17        INIT_METHOD_CALL                                         !3, 'format'
         18        SEND_VAL_EX                                              'Y-m-d+H%3Ai%3As'
         19        DO_FCALL                                      0  $17     
         20        SEND_VAR                                                 $17
         21        DO_ICALL                                         $18     
         22        INIT_FCALL                                               'strtotime'
         23        INIT_METHOD_CALL                                         !0, 'format'
         24        SEND_VAL_EX                                              'Y-m-d+H%3Ai%3As'
         25        DO_FCALL                                      0  $19     
         26        SEND_VAR                                                 $19
         27        DO_ICALL                                         $20     
         28        SUB                                              ~21     $18, $20
         29        DIV                                              ~22     ~21, 3600
         30        ASSIGN                                                   !4, ~22
    7    31        CONCAT                                           ~24     !4, '%0A'
         32        ECHO                                                     ~24
    8    33        INIT_METHOD_CALL                                         !0, 'format'
         34        SEND_VAL_EX                                              'Y-m-d+H%3Ai%3As'
         35        DO_FCALL                                      0  $25     
         36        CONCAT                                           ~26     $25, '%0A'
         37        ECHO                                                     ~26
    9    38        INIT_METHOD_CALL                                         !1, 'format'
         39        SEND_VAL_EX                                              'Y-m-d+H%3Ai%3As'
         40        DO_FCALL                                      0  $27     
         41        CONCAT                                           ~28     $27, '%0A'
         42        ECHO                                                     ~28
   10    43        INIT_METHOD_CALL                                         !2, 'format'
         44        SEND_VAL_EX                                              'Y-m-d+H%3Ai%3As'
         45        DO_FCALL                                      0  $29     
         46        CONCAT                                           ~30     $29, '%0A'
         47        ECHO                                                     ~30
   11    48        IS_SMALLER                                       ~31     !1, !0
         49      > JMPZ_EX                                          ~31     ~31, ->52
         50    >   IS_SMALLER                                       ~32     !0, !2
         51        BOOL                                             ~31     ~32
         52    > > JMPZ_EX                                          ~31     ~31, ->55
         53    >   IS_SMALLER_OR_EQUAL                              ~33     !4, 72
         54        BOOL                                             ~31     ~33
         55    > > JMPZ                                                     ~31, ->57
   12    56    >   ECHO                                                     'Error%21+Please+contact+administrator%21'
   13    57    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.96 ms | 1400 KiB | 15 Q