3v4l.org

run code in 300+ 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:  15
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        INIT_FCALL                                               'preg_replace'
          3        INIT_FCALL                                               'implode'
          4        SEND_VAL                                                 '%7C'
          5        SEND_VAR                                                 !1
          6        DO_ICALL                                         $4      
          7        CONCAT                                           ~5      '%7E%5C.%28%3F%21%28%3F%3A', $4
          8        CONCAT                                           ~6      ~5, '%29%5Cb%29%7Ei'
          9        SEND_VAL                                                 ~6
         10        SEND_VAL                                                 '%3F'
         11        SEND_VAR                                                 !0
         12        DO_ICALL                                         $7      
         13        ECHO                                                     $7
         14      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
239.88 ms | 1001 KiB | 15 Q