3v4l.org

run code in 300+ PHP versions simultaneously
<?php $input = 'http://#chrütli24/7schwur.ch'; $input = 'www.meinemüllerdomain.ch/index/checkMe?param#whatevs'; $pattern = array(); $pattern[] = '/\xE2\x80\x8B/'; $pattern[] = '/ /'; $pattern[] = '@^[a-z]+://@i'; $pattern[] = '/&#8203;/'; $pattern[] = '/\?/'; $pattern[] = '@^www\.@i'; // if entered, remove whitespaces, prepending protocoll and www. $cleaned = preg_replace($pattern, null, idn_to_utf8(mb_strtolower($input, 'UTF-8'))); //echo $cleaned; // if entered, remove trailing dot $cleaned = (substr($cleaned, -1) == '.') ? substr($cleaned, 0, -1) : $cleaned; //echo $cleaned; if (strpos($cleaned, '@') !== false) { echo 'false'; } $val = filter_var(idn_to_ascii($cleaned), FILTER_VALIDATE_URL); var_dump($val); $correct = filter_var('http://'.$cleaned, FILTER_VALIDATE_URL); var_dump($correct); //var_dump(parse_url($correct)); $testdomain = idn_to_ascii($cleaned); var_dump(filter_var($testdomain, FILTER_VALIDATE_URL));
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 34, Position 2 = 41
Branch analysis from position: 34
1 jumps found. (Code = 42) Position 1 = 42
Branch analysis from position: 42
2 jumps found. (Code = 43) Position 1 = 49, Position 2 = 50
Branch analysis from position: 49
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 50
Branch analysis from position: 41
2 jumps found. (Code = 43) Position 1 = 49, Position 2 = 50
Branch analysis from position: 49
Branch analysis from position: 50
filename:       /in/Sdoi1
function name:  (null)
number of ops:  82
compiled vars:  !0 = $input, !1 = $pattern, !2 = $cleaned, !3 = $val, !4 = $correct, !5 = $testdomain
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'http%3A%2F%2F%23chr%C3%BCtli24%2F7schwur.ch'
    4     1        ASSIGN                                                   !0, 'www.meinem%C3%BCllerdomain.ch%2Findex%2FcheckMe%3Fparam%23whatevs'
    6     2        ASSIGN                                                   !1, <array>
    7     3        ASSIGN_DIM                                               !1
          4        OP_DATA                                                  '%2F%5CxE2%5Cx80%5Cx8B%2F'
    8     5        ASSIGN_DIM                                               !1
          6        OP_DATA                                                  '%2F+%2F'
    9     7        ASSIGN_DIM                                               !1
          8        OP_DATA                                                  '%40%5E%5Ba-z%5D%2B%3A%2F%2F%40i'
   10     9        ASSIGN_DIM                                               !1
         10        OP_DATA                                                  '%2F%26%238203%3B%2F'
   11    11        ASSIGN_DIM                                               !1
         12        OP_DATA                                                  '%2F%5C%3F%2F'
   12    13        ASSIGN_DIM                                               !1
         14        OP_DATA                                                  '%40%5Ewww%5C.%40i'
   15    15        INIT_FCALL                                               'preg_replace'
         16        SEND_VAR                                                 !1
         17        SEND_VAL                                                 null
         18        INIT_FCALL_BY_NAME                                       'idn_to_utf8'
         19        INIT_FCALL                                               'mb_strtolower'
         20        SEND_VAR                                                 !0
         21        SEND_VAL                                                 'UTF-8'
         22        DO_ICALL                                         $15     
         23        SEND_VAR_NO_REF_EX                                       $15
         24        DO_FCALL                                      0  $16     
         25        SEND_VAR                                                 $16
         26        DO_ICALL                                         $17     
         27        ASSIGN                                                   !2, $17
   19    28        INIT_FCALL                                               'substr'
         29        SEND_VAR                                                 !2
         30        SEND_VAL                                                 -1
         31        DO_ICALL                                         $19     
         32        IS_EQUAL                                                 $19, '.'
         33      > JMPZ                                                     ~20, ->41
         34    >   INIT_FCALL                                               'substr'
         35        SEND_VAR                                                 !2
         36        SEND_VAL                                                 0
         37        SEND_VAL                                                 -1
         38        DO_ICALL                                         $21     
         39        QM_ASSIGN                                        ~22     $21
         40      > JMP                                                      ->42
         41    >   QM_ASSIGN                                        ~22     !2
         42    >   ASSIGN                                                   !2, ~22
   22    43        INIT_FCALL                                               'strpos'
         44        SEND_VAR                                                 !2
         45        SEND_VAL                                                 '%40'
         46        DO_ICALL                                         $24     
         47        TYPE_CHECK                                  1018          $24
         48      > JMPZ                                                     ~25, ->50
   23    49    >   ECHO                                                     'false'
   26    50    >   INIT_FCALL                                               'filter_var'
         51        INIT_FCALL_BY_NAME                                       'idn_to_ascii'
         52        SEND_VAR_EX                                              !2
         53        DO_FCALL                                      0  $26     
         54        SEND_VAR                                                 $26
         55        SEND_VAL                                                 273
         56        DO_ICALL                                         $27     
         57        ASSIGN                                                   !3, $27
   27    58        INIT_FCALL                                               'var_dump'
         59        SEND_VAR                                                 !3
         60        DO_ICALL                                                 
   29    61        INIT_FCALL                                               'filter_var'
         62        CONCAT                                           ~30     'http%3A%2F%2F', !2
         63        SEND_VAL                                                 ~30
         64        SEND_VAL                                                 273
         65        DO_ICALL                                         $31     
         66        ASSIGN                                                   !4, $31
   30    67        INIT_FCALL                                               'var_dump'
         68        SEND_VAR                                                 !4
         69        DO_ICALL                                                 
   34    70        INIT_FCALL_BY_NAME                                       'idn_to_ascii'
         71        SEND_VAR_EX                                              !2
         72        DO_FCALL                                      0  $34     
         73        ASSIGN                                                   !5, $34
   35    74        INIT_FCALL                                               'var_dump'
         75        INIT_FCALL                                               'filter_var'
         76        SEND_VAR                                                 !5
         77        SEND_VAL                                                 273
         78        DO_ICALL                                         $36     
         79        SEND_VAR                                                 $36
         80        DO_ICALL                                                 
         81      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
181.69 ms | 1400 KiB | 25 Q