3v4l.org

run code in 300+ PHP versions simultaneously
<?php $curtime = '0010'; var_dump($curtime); $trading_hour['AT_open'] = '1715'; $trading_hour['AT_close'] = '2500'; $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) { $result = 'AT'; } } else { if ($curtime >= $trading_hour['AT_open'] && $curtime <= $AT_close) { $result = 'AT'; } } 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 = 44
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 = 35
Branch analysis from position: 31
2 jumps found. (Code = 43) Position 1 = 33, Position 2 = 34
Branch analysis from position: 33
1 jumps found. (Code = 42) Position 1 = 42
Branch analysis from position: 42
1 jumps found. (Code = 42) Position 1 = 45
Branch analysis from position: 45
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 34
Branch analysis from position: 35
2 jumps found. (Code = 46) Position 1 = 38, Position 2 = 40
Branch analysis from position: 38
2 jumps found. (Code = 43) Position 1 = 41, Position 2 = 42
Branch analysis from position: 41
1 jumps found. (Code = 42) Position 1 = 45
Branch analysis from position: 45
Branch analysis from position: 42
Branch analysis from position: 40
Branch analysis from position: 30
Branch analysis from position: 44
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
Branch analysis from position: 16
filename:       /in/ajKmI
function name:  (null)
number of ops:  46
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, '0010'
    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                                                  '2500'
    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, ->44
   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, ->35
   23    31    >   IS_SMALLER_OR_EQUAL                                      !0, !4
         32      > JMPZ                                                     ~22, ->34
   25    33    >   ASSIGN                                                   !2, 'AT'
         34    > > JMP                                                      ->42
   30    35    >   FETCH_DIM_R                                      ~24     !1, 'AT_open'
         36        IS_SMALLER_OR_EQUAL                              ~25     ~24, !0
         37      > JMPZ_EX                                          ~25     ~25, ->40
         38    >   IS_SMALLER_OR_EQUAL                              ~26     !0, !4
         39        BOOL                                             ~25     ~26
         40    > > JMPZ                                                     ~25, ->42
   32    41    >   ASSIGN                                                   !2, 'AT'
   35    42    >   ECHO                                                     !2
         43      > JMP                                                      ->45
   39    44    >   ECHO                                                     'stop'
   40    45    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.46 ms | 1400 KiB | 17 Q