3v4l.org

run code in 300+ PHP versions simultaneously
<?php $url = $_GET["u"]; if(parse_url($url, PHP_URL_HOST) === "example.com" ) { echo "<script>window.location.href = '" . htmlspecialchars($url, ENT_QUOTES) . "';</script>"; } else { echo "<script>window.location.href = 'https://example.com';</script>"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 17
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/PU24n
function name:  (null)
number of ops:  19
compiled vars:  !0 = $url
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   FETCH_R                      global              ~1      '_GET'
          1        FETCH_DIM_R                                      ~2      ~1, 'u'
          2        ASSIGN                                                   !0, ~2
    5     3        INIT_FCALL                                               'parse_url'
          4        SEND_VAR                                                 !0
          5        SEND_VAL                                                 1
          6        DO_ICALL                                         $4      
          7        IS_IDENTICAL                                             $4, 'example.com'
          8      > JMPZ                                                     ~5, ->17
    6     9    >   INIT_FCALL                                               'htmlspecialchars'
         10        SEND_VAR                                                 !0
         11        SEND_VAL                                                 3
         12        DO_ICALL                                         $6      
         13        CONCAT                                           ~7      '%3Cscript%3Ewindow.location.href+%3D+%27', $6
         14        CONCAT                                           ~8      ~7, '%27%3B%3C%2Fscript%3E'
         15        ECHO                                                     ~8
    5    16      > JMP                                                      ->18
    8    17    >   ECHO                                                     '%3Cscript%3Ewindow.location.href+%3D+%27https%3A%2F%2Fexample.com%27%3B%3C%2Fscript%3E'
    9    18    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
175.35 ms | 1446 KiB | 15 Q