3v4l.org

run code in 300+ 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 = 13, Position 2 = 15
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/nUCfH
function name:  (null)
number of ops:  17
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        INIT_FCALL                                               'in_array'
          8        SEND_VAR                                                 !0
          9        SEND_VAR                                                 !1
         10        DO_ICALL                                         $6      
         11        BOOL_NOT                                         ~7      $6
         12      > JMPZ                                                     ~7, ->15
    8    13    >   ECHO                                                     'invalid+URL'
    6    14      > JMP                                                      ->16
   10    15    >   ECHO                                                     'valid+URL'
   12    16    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
142.84 ms | 1445 KiB | 15 Q