3v4l.org

run code in 500+ PHP versions simultaneously
<?php $string = "An example of a website would be google.com or similar. However this is not what we are looking for"; $tlds = ['com', 'org', 'net']; echo preg_replace('~\.(?!(?:' . implode('|', $tlds) . ')\b)~i', '?', $string);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mLXjc
function name:  (null)
number of ops:  9
compiled vars:  !0 = $string, !1 = $tlds
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, 'An+example+of+a+website+would+be+google.com+or+similar.+However+this+is+not+what+we+are+looking+for'
    4     1        ASSIGN                                                       !1, <array>
    5     2        FRAMELESS_ICALL_2                implode             ~4      '%7C', !1
          3        CONCAT                                               ~5      '%7E%5C.%28%3F%21%28%3F%3A', ~4
          4        CONCAT                                               ~6      ~5, '%29%5Cb%29%7Ei'
          5        FRAMELESS_ICALL_3                preg_replace        ~7      ~6, '%3F'
          6        OP_DATA                                                      !0
          7        ECHO                                                         ~7
          8      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
156.67 ms | 1997 KiB | 17 Q