3v4l.org

run code in 500+ PHP versions simultaneously
<?php $url = 'http://mydomain.com/u/123-test'; $url = parse_url($url, PHP_URL_HOST); //$url is POST from input field $domain = array('mydomain.com', 'mydomain.net'); if (!in_array($url, $domain)) { echo 'invalid URL'; }else{ echo 'valid URL'; } ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 12
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/nUCfH
function name:  (null)
number of ops:  14
compiled vars:  !0 = $url, !1 = $domain
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                       !0, 'http%3A%2F%2Fmydomain.com%2Fu%2F123-test'
    3     1        INIT_FCALL                                                   'parse_url'
          2        SEND_VAR                                                     !0
          3        SEND_VAL                                                     1
          4        DO_ICALL                                             $3      
          5        ASSIGN                                                       !0, $3
    4     6        ASSIGN                                                       !1, <array>
    6     7        FRAMELESS_ICALL_2                in_array            ~6      !0, !1
          8        BOOL_NOT                                             ~7      ~6
          9      > JMPZ                                                         ~7, ->12
    8    10    >   ECHO                                                         'invalid+URL'
    6    11      > JMP                                                          ->13
   10    12    >   ECHO                                                         'valid+URL'
   12    13    > > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
155.91 ms | 2277 KiB | 14 Q