3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $start = new \DateTime('01.10.2015'); $end = new \DateTime('08.10.2015'); $endYesterday = new \DateTime('07.10.2015'); $today = new \DateTime('midnight'); if ($today < $start || $today > $end) { var_dump('Сегодня заканчивается'); } if ($today < $start || $today > $endYesterday) { var_dump( 'Закончилось вчера'); } $end = new \DateTime('09.10.2015'); if ($today < $start || $today > $end) { var_dump( 'Неверно, завтра заканчивается'); } else { var_dump( 'Закончится завтра, в иф не вошли'); } $start = new \DateTime('09.10.2015'); $end = new \DateTime('12.10.2015'); if ($today < $start || $today > $end) { var_dump( 'Неверно, еще не началось 09.10.2015'); } $start = new \DateTime('08.10.2015'); $end = new \DateTime('12.10.2015'); if ($today < $start || $today > $end) { var_dump( 'Неверно, сегодня началось'); }else { var_dump( 'Верно, сегодня началось'); }
based on Q5UXl
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = 18, Position 2 = 20
Branch analysis from position: 18
Jump found. Position 1 = 21, Position 2 = 24
Branch analysis from position: 21
Jump found. Position 1 = 26, Position 2 = 28
Branch analysis from position: 26
Jump found. Position 1 = 29, Position 2 = 32
Branch analysis from position: 29
Jump found. Position 1 = 38, Position 2 = 40
Branch analysis from position: 38
Jump found. Position 1 = 41, Position 2 = 45
Branch analysis from position: 41
Jump found. Position 1 = 48
Branch analysis from position: 48
Jump found. Position 1 = 58, Position 2 = 60
Branch analysis from position: 58
Jump found. Position 1 = 61, Position 2 = 64
Branch analysis from position: 61
Jump found. Position 1 = 74, Position 2 = 76
Branch analysis from position: 74
Jump found. Position 1 = 77, Position 2 = 81
Branch analysis from position: 77
Jump found. Position 1 = 84
Branch analysis from position: 84
Jump found. Position 1 = -2
Branch analysis from position: 81
Jump found. Position 1 = -2
Branch analysis from position: 76
Branch analysis from position: 64
Branch analysis from position: 60
Branch analysis from position: 45
Jump found. Position 1 = 58, Position 2 = 60
Branch analysis from position: 58
Branch analysis from position: 60
Branch analysis from position: 40
Branch analysis from position: 32
Branch analysis from position: 28
Branch analysis from position: 24
Branch analysis from position: 20
filename:       /in/S2ooW
function name:  (null)
number of ops:  85
compiled vars:  !0 = $start, !1 = $end, !2 = $endYesterday, !3 = $today
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   4     0  E >   NEW                                              $4      :-6
         1        SEND_VAL_EX                                              '01.10.2015'
         2        DO_FCALL                                      0          
         3        ASSIGN                                                   !0, $4
   5     4        NEW                                              $7      :-3
         5        SEND_VAL_EX                                              '08.10.2015'
         6        DO_FCALL                                      0          
         7        ASSIGN                                                   !1, $7
   6     8        NEW                                              $10     :0
         9        SEND_VAL_EX                                              '07.10.2015'
        10        DO_FCALL                                      0          
        11        ASSIGN                                                   !2, $10
   8    12        NEW                                              $13     :3
        13        SEND_VAL_EX                                              'midnight'
        14        DO_FCALL                                      0          
        15        ASSIGN                                                   !3, $13
  10    16        IS_SMALLER                                       ~16     !3, !0
        17      > JMPNZ_EX                                         ~16     ~16, ->20
        18    >   IS_SMALLER                                       ~17     !1, !3
        19        BOOL                                             ~16     ~17
        20    > > JMPZ                                                     ~16, ->24
  11    21    >   INIT_FCALL                                               'var_dump'
        22        SEND_VAL                                                 '%D0%A1%D0%B5%D0%B3%D0%BE%D0%B4%D0%BD%D1%8F+%D0%B7%D0%B0%D0%BA%D0%B0%D0%BD%D1%87%D0%B8%D0%B2%D0%B0%D0%B5%D1%82%D1%81%D1%8F'
        23        DO_ICALL                                                 
  14    24    >   IS_SMALLER                                       ~19     !3, !0
        25      > JMPNZ_EX                                         ~19     ~19, ->28
        26    >   IS_SMALLER                                       ~20     !2, !3
        27        BOOL                                             ~19     ~20
        28    > > JMPZ                                                     ~19, ->32
  15    29    >   INIT_FCALL                                               'var_dump'
        30        SEND_VAL                                                 '%D0%97%D0%B0%D0%BA%D0%BE%D0%BD%D1%87%D0%B8%D0%BB%D0%BE%D1%81%D1%8C+%D0%B2%D1%87%D0%B5%D1%80%D0%B0'
        31        DO_ICALL                                                 
  18    32    >   NEW                                              $22     :10
        33        SEND_VAL_EX                                              '09.10.2015'
        34        DO_FCALL                                      0          
        35        ASSIGN                                                   !1, $22
  19    36        IS_SMALLER                                       ~25     !3, !0
        37      > JMPNZ_EX                                         ~25     ~25, ->40
        38    >   IS_SMALLER                                       ~26     !1, !3
        39        BOOL                                             ~25     ~26
        40    > > JMPZ                                                     ~25, ->45
  20    41    >   INIT_FCALL                                               'var_dump'
        42        SEND_VAL                                                 '%D0%9D%D0%B5%D0%B2%D0%B5%D1%80%D0%BD%D0%BE%2C+%D0%B7%D0%B0%D0%B2%D1%82%D1%80%D0%B0+%D0%B7%D0%B0%D0%BA%D0%B0%D0%BD%D1%87%D0%B8%D0%B2%D0%B0%D0%B5%D1%82%D1%81%D1%8F'
        43        DO_ICALL                                                 
        44      > JMP                                                      ->48
  22    45    >   INIT_FCALL                                               'var_dump'
        46        SEND_VAL                                                 '%D0%97%D0%B0%D0%BA%D0%BE%D0%BD%D1%87%D0%B8%D1%82%D1%81%D1%8F+%D0%B7%D0%B0%D0%B2%D1%82%D1%80%D0%B0%2C+%D0%B2+%D0%B8%D1%84+%D0%BD%D0%B5+%D0%B2%D0%BE%D1%88%D0%BB%D0%B8'
        47        DO_ICALL                                                 
  25    48    >   NEW                                              $29     :17
        49        SEND_VAL_EX                                              '09.10.2015'
        50        DO_FCALL                                      0          
        51        ASSIGN                                                   !0, $29
  26    52        NEW                                              $32     :20
        53        SEND_VAL_EX                                              '12.10.2015'
        54        DO_FCALL                                      0          
        55        ASSIGN                                                   !1, $32
  27    56        IS_SMALLER                                       ~35     !3, !0
        57      > JMPNZ_EX                                         ~35     ~35, ->60
        58    >   IS_SMALLER                                       ~36     !1, !3
        59        BOOL                                             ~35     ~36
        60    > > JMPZ                                                     ~35, ->64
  28    61    >   INIT_FCALL                                               'var_dump'
        62        SEND_VAL                                                 '%D0%9D%D0%B5%D0%B2%D0%B5%D1%80%D0%BD%D0%BE%2C+%D0%B5%D1%89%D0%B5+%D0%BD%D0%B5+%D0%BD%D0%B0%D1%87%D0%B0%D0%BB%D0%BE%D1%81%D1%8C+09.10.2015'
        63        DO_ICALL                                                 
  32    64    >   NEW                                              $38     :25
        65        SEND_VAL_EX                                              '08.10.2015'
        66        DO_FCALL                                      0          
        67        ASSIGN                                                   !0, $38
  33    68        NEW                                              $41     :28
        69        SEND_VAL_EX                                              '12.10.2015'
        70        DO_FCALL                                      0          
        71        ASSIGN                                                   !1, $41
  34    72        IS_SMALLER                                       ~44     !3, !0
        73      > JMPNZ_EX                                         ~44     ~44, ->76
        74    >   IS_SMALLER                                       ~45     !1, !3
        75        BOOL                                             ~44     ~45
        76    > > JMPZ                                                     ~44, ->81
  35    77    >   INIT_FCALL                                               'var_dump'
        78        SEND_VAL                                                 '%D0%9D%D0%B5%D0%B2%D0%B5%D1%80%D0%BD%D0%BE%2C+%D1%81%D0%B5%D0%B3%D0%BE%D0%B4%D0%BD%D1%8F+%D0%BD%D0%B0%D1%87%D0%B0%D0%BB%D0%BE%D1%81%D1%8C'
        79        DO_ICALL                                                 
        80      > JMP                                                      ->84
  37    81    >   INIT_FCALL                                               'var_dump'
        82        SEND_VAL                                                 '%D0%92%D0%B5%D1%80%D0%BD%D0%BE%2C+%D1%81%D0%B5%D0%B3%D0%BE%D0%B4%D0%BD%D1%8F+%D0%BD%D0%B0%D1%87%D0%B0%D0%BB%D0%BE%D1%81%D1%8C'
        83        DO_ICALL                                                 
        84    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 7.3.0