3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
169.13 ms | 1399 KiB | 13 Q