3v4l.org

run code in 300+ PHP versions simultaneously
<?php $curtime = '1810'; var_dump($curtime); $trading_hour['AT_open'] = '1715'; $trading_hour['AT_close'] = '2345'; $result = 'N'; if ($curtime <= '0100' || ($curtime >= '0830' && $curtime <= '2359')) { $isOverMidnight = false; $AT_close = $trading_hour['AT_close']; if ($AT_close > '2359') { $isOverMidnight = true; $AT_close = $AT_close - '2400'; $AT_close = sprintf('%04d', $AT_close); } if ($isOverMidnight) { if ($curtime <= $AT_close || ($curtime >= $trading_hour['AT_open'] && $curtime <= '2359')) { $result = 'AT1'; } } else { if ($curtime >= $trading_hour['AT_open'] && $curtime <= $AT_close) { $result = 'AT2'; } } echo $result; } else { echo 'stop'; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 47) Position 1 = 11, Position 2 = 16
Branch analysis from position: 11
2 jumps found. (Code = 46) Position 1 = 13, Position 2 = 15
Branch analysis from position: 13
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 51
Branch analysis from position: 17
2 jumps found. (Code = 43) Position 1 = 22, Position 2 = 30
Branch analysis from position: 22
2 jumps found. (Code = 43) Position 1 = 31, Position 2 = 42
Branch analysis from position: 31
2 jumps found. (Code = 47) Position 1 = 33, Position 2 = 39
Branch analysis from position: 33
2 jumps found. (Code = 46) Position 1 = 36, Position 2 = 38
Branch analysis from position: 36
2 jumps found. (Code = 43) Position 1 = 40, Position 2 = 41
Branch analysis from position: 40
1 jumps found. (Code = 42) Position 1 = 49
Branch analysis from position: 49
1 jumps found. (Code = 42) Position 1 = 52
Branch analysis from position: 52
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 41
Branch analysis from position: 38
Branch analysis from position: 39
Branch analysis from position: 42
2 jumps found. (Code = 46) Position 1 = 45, Position 2 = 47
Branch analysis from position: 45
2 jumps found. (Code = 43) Position 1 = 48, Position 2 = 49
Branch analysis from position: 48
1 jumps found. (Code = 42) Position 1 = 52
Branch analysis from position: 52
Branch analysis from position: 49
Branch analysis from position: 47
Branch analysis from position: 30
Branch analysis from position: 51
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
Branch analysis from position: 16
filename:       /in/MKCiN
function name:  (null)
number of ops:  53
compiled vars:  !0 = $curtime, !1 = $trading_hour, !2 = $result, !3 = $isOverMidnight, !4 = $AT_close
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '1810'
    4     1        INIT_FCALL                                               'var_dump'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                                 
    6     4        ASSIGN_DIM                                               !1, 'AT_open'
          5        OP_DATA                                                  '1715'
    7     6        ASSIGN_DIM                                               !1, 'AT_close'
          7        OP_DATA                                                  '2345'
    9     8        ASSIGN                                                   !2, 'N'
   11     9        IS_SMALLER_OR_EQUAL                              ~10     !0, '0100'
         10      > JMPNZ_EX                                         ~10     ~10, ->16
         11    >   IS_SMALLER_OR_EQUAL                              ~11     '0830', !0
         12      > JMPZ_EX                                          ~11     ~11, ->15
         13    >   IS_SMALLER_OR_EQUAL                              ~12     !0, '2359'
         14        BOOL                                             ~11     ~12
         15    >   BOOL                                             ~10     ~11
         16    > > JMPZ                                                     ~10, ->51
   13    17    >   ASSIGN                                                   !3, <false>
   14    18        FETCH_DIM_R                                      ~14     !1, 'AT_close'
         19        ASSIGN                                                   !4, ~14
   15    20        IS_SMALLER                                               '2359', !4
         21      > JMPZ                                                     ~16, ->30
   17    22    >   ASSIGN                                                   !3, <true>
   18    23        SUB                                              ~18     !4, '2400'
         24        ASSIGN                                                   !4, ~18
   19    25        INIT_FCALL                                               'sprintf'
         26        SEND_VAL                                                 '%2504d'
         27        SEND_VAR                                                 !4
         28        DO_ICALL                                         $20     
         29        ASSIGN                                                   !4, $20
   21    30    > > JMPZ                                                     !3, ->42
   23    31    >   IS_SMALLER_OR_EQUAL                              ~22     !0, !4
         32      > JMPNZ_EX                                         ~22     ~22, ->39
         33    >   FETCH_DIM_R                                      ~23     !1, 'AT_open'
         34        IS_SMALLER_OR_EQUAL                              ~24     ~23, !0
         35      > JMPZ_EX                                          ~24     ~24, ->38
         36    >   IS_SMALLER_OR_EQUAL                              ~25     !0, '2359'
         37        BOOL                                             ~24     ~25
         38    >   BOOL                                             ~22     ~24
         39    > > JMPZ                                                     ~22, ->41
   25    40    >   ASSIGN                                                   !2, 'AT1'
         41    > > JMP                                                      ->49
   30    42    >   FETCH_DIM_R                                      ~27     !1, 'AT_open'
         43        IS_SMALLER_OR_EQUAL                              ~28     ~27, !0
         44      > JMPZ_EX                                          ~28     ~28, ->47
         45    >   IS_SMALLER_OR_EQUAL                              ~29     !0, !4
         46        BOOL                                             ~28     ~29
         47    > > JMPZ                                                     ~28, ->49
   32    48    >   ASSIGN                                                   !2, 'AT2'
   35    49    >   ECHO                                                     !2
         50      > JMP                                                      ->52
   39    51    >   ECHO                                                     'stop'
   40    52    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.32 ms | 1400 KiB | 17 Q