3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = <<<STR <img/onerror=alert(1) src=ONE <img onerror=alert(1) src=TWO> <img/ onerror=alert(1) src=THREE// <img/onerror=alert(1) src=FOUR> STR; echo preg_replace('#<img/?\s*[^>/x{0C}]*(?=src\s*=)(?:src\s*=\s*["\']?([^"\'<>\s]*)["\']?[^>/x{0C}]*)?(?:>|//|\x{0C})#isu', '$1', $str);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lr9uS
function name:  (null)
number of ops:  8
compiled vars:  !0 = $str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%0A%3Cimg%2Fonerror%3Dalert%281%29+src%3DONE%0C%0A%3Cimg+onerror%3Dalert%281%29+src%3DTWO%3E%0A%3Cimg%2F+onerror%3Dalert%281%29+src%3DTHREE%2F%2F%0A%3Cimg%2Fonerror%3Dalert%281%29+src%3DFOUR%3E%0A'
   10     1        INIT_FCALL                                               'preg_replace'
          2        SEND_VAL                                                 '%23%3Cimg%2F%3F%5Cs%2A%5B%5E%3E%2Fx%7B0C%7D%5D%2A%28%3F%3Dsrc%5Cs%2A%3D%29%28%3F%3Asrc%5Cs%2A%3D%5Cs%2A%5B%22%27%5D%3F%28%5B%5E%22%27%3C%3E%5Cs%5D%2A%29%5B%22%27%5D%3F%5B%5E%3E%2Fx%7B0C%7D%5D%2A%29%3F%28%3F%3A%3E%7C%2F%2F%7C%5Cx%7B0C%7D%29%23isu'
          3        SEND_VAL                                                 '%241'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $2      
          6        ECHO                                                     $2
          7      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
308.4 ms | 1014 KiB | 14 Q