3v4l.org

run code in 500+ PHP versions simultaneously
<?php $url = 'https://www.example.com/pagename?a=b&c=d'; $paths = [ 'gerp', 'pagename', 'cheese', ]; $path = trim(parse_url($url, PHP_URL_PATH), '/'); if ( in_array($path, $paths )) { echo 'yes'; } else { echo 'no'; }
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/NOmpk
function name:  (null)
number of ops:  14
compiled vars:  !0 = $url, !1 = $paths, !2 = $path
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, 'https%3A%2F%2Fwww.example.com%2Fpagename%3Fa%3Db%26c%3Dd'
    5     1        ASSIGN                                                       !1, <array>
   12     2        INIT_FCALL                                                   'parse_url'
          3        SEND_VAR                                                     !0
          4        SEND_VAL                                                     5
          5        DO_ICALL                                             $5      
          6        FRAMELESS_ICALL_2                trim                ~6      $5, '%2F'
          7        ASSIGN                                                       !2, ~6
   13     8        FRAMELESS_ICALL_2                in_array            ~8      !2, !1
          9      > JMPZ                                                         ~8, ->12
   14    10    >   ECHO                                                         'yes'
   13    11      > JMP                                                          ->13
   16    12    >   ECHO                                                         'no'
   17    13    > > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
148.79 ms | 1874 KiB | 14 Q