3v4l.org

run code in 300+ PHP versions simultaneously
<?php $current_day = date('N'); // Current day of the week as a number (1-7) - Sunday is first day of the week $current_hour = date('H'); // Current hour in 24 hr format if($current_day < 6) { // Check if it's Monday - Friday if($current_hour > 1 && $current_hour < 9) { // time is between 1 and 9 AM--> echo "123"; } elseif($current_hour > 9 && $current_hour < 18) { // time is between 9 am and 6 pm--> echo "456"; } elseif($current_hour > 18 && $current_hour < 23) { // time is between 6 pm and 11 pm--> echo "789"; } else { // time is none of the above--> echo "101112"; } } else { // EVERYTHING ELSE--> echo "131415"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 33
Branch analysis from position: 10
2 jumps found. (Code = 46) Position 1 = 12, Position 2 = 14
Branch analysis from position: 12
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 17
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 32
Branch analysis from position: 32
1 jumps found. (Code = 42) Position 1 = 34
Branch analysis from position: 34
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
2 jumps found. (Code = 46) Position 1 = 19, Position 2 = 21
Branch analysis from position: 19
2 jumps found. (Code = 43) Position 1 = 22, Position 2 = 24
Branch analysis from position: 22
1 jumps found. (Code = 42) Position 1 = 32
Branch analysis from position: 32
Branch analysis from position: 24
2 jumps found. (Code = 46) Position 1 = 26, Position 2 = 28
Branch analysis from position: 26
2 jumps found. (Code = 43) Position 1 = 29, Position 2 = 31
Branch analysis from position: 29
1 jumps found. (Code = 42) Position 1 = 32
Branch analysis from position: 32
Branch analysis from position: 31
1 jumps found. (Code = 42) Position 1 = 34
Branch analysis from position: 34
Branch analysis from position: 28
Branch analysis from position: 21
Branch analysis from position: 14
Branch analysis from position: 33
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vpGS1
function name:  (null)
number of ops:  35
compiled vars:  !0 = $current_day, !1 = $current_hour
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'date'
          1        SEND_VAL                                                 'N'
          2        DO_ICALL                                         $2      
          3        ASSIGN                                                   !0, $2
    3     4        INIT_FCALL                                               'date'
          5        SEND_VAL                                                 'H'
          6        DO_ICALL                                         $4      
          7        ASSIGN                                                   !1, $4
    4     8        IS_SMALLER                                               !0, 6
          9      > JMPZ                                                     ~6, ->33
    6    10    >   IS_SMALLER                                       ~7      1, !1
         11      > JMPZ_EX                                          ~7      ~7, ->14
         12    >   IS_SMALLER                                       ~8      !1, 9
         13        BOOL                                             ~7      ~8
         14    > > JMPZ                                                     ~7, ->17
    7    15    >   ECHO                                                     '123'
         16      > JMP                                                      ->32
    9    17    >   IS_SMALLER                                       ~9      9, !1
         18      > JMPZ_EX                                          ~9      ~9, ->21
         19    >   IS_SMALLER                                       ~10     !1, 18
         20        BOOL                                             ~9      ~10
         21    > > JMPZ                                                     ~9, ->24
   10    22    >   ECHO                                                     '456'
         23      > JMP                                                      ->32
   12    24    >   IS_SMALLER                                       ~11     18, !1
         25      > JMPZ_EX                                          ~11     ~11, ->28
         26    >   IS_SMALLER                                       ~12     !1, 23
         27        BOOL                                             ~11     ~12
         28    > > JMPZ                                                     ~11, ->31
   13    29    >   ECHO                                                     '789'
         30      > JMP                                                      ->32
   16    31    >   ECHO                                                     '101112'
         32    > > JMP                                                      ->34
   20    33    >   ECHO                                                     '131415'
   21    34    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.93 ms | 1405 KiB | 15 Q