3v4l.org

run code in 500+ PHP versions simultaneously
<?php $strings = [ "http://regex101.", "http://www.regex101.", "https://regex101.", "https://www.regex101.", "https://www.mydomain.", "https://mydomain." ]; $pattern = "~^https?://(?:www\.)?+(?!mydomain\.)\S+$~"; foreach ($strings as $s) { if (preg_match($pattern, $s)) { echo "Match: $s" . PHP_EOL; } else { echo "No match: $s" . PHP_EOL; } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 16
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 16
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 11
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
filename:       /in/ghZiA
function name:  (null)
number of ops:  18
compiled vars:  !0 = $strings, !1 = $pattern, !2 = $s
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
   11     1        ASSIGN                                                       !1, '%7E%5Ehttps%3F%3A%2F%2F%28%3F%3Awww%5C.%29%3F%2B%28%3F%21mydomain%5C.%29%5CS%2B%24%7E'
   12     2      > FE_RESET_R                                           $5      !0, ->16
          3    > > FE_FETCH_R                                                   $5, !2, ->16
   13     4    >   FRAMELESS_ICALL_2                preg_match          ~6      !1, !2
          5      > JMPZ                                                         ~6, ->11
   14     6    >   NOP                                                          
          7        FAST_CONCAT                                          ~7      'Match%3A+', !2
          8        CONCAT                                               ~8      ~7, '%0A'
          9        ECHO                                                         ~8
   13    10      > JMP                                                          ->15
   16    11    >   NOP                                                          
         12        FAST_CONCAT                                          ~9      'No+match%3A+', !2
         13        CONCAT                                               ~10     ~9, '%0A'
         14        ECHO                                                         ~10
   12    15    > > JMP                                                          ->3
         16    >   FE_FREE                                                      $5
   18    17      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
222.18 ms | 2082 KiB | 13 Q