3v4l.org

run code in 300+ PHP versions simultaneously
<?php function OhYea2GunNukesSpamUsingDruszAvatarAndLotsOfHardcodedCrapYOLOSWAGHeyKarlSupMan($input) { $blacklist = array('a-xxx-site-with-spam.com','visual.merriam-webster.com','example.com'); $output=$input; foreach ($blacklist as $a_blacklisted) { $output = preg_replace('/<img(.*?)src=.http(.*?)'.str_replace('.','\.',$a_blacklisted).'(.*?)>/', '<img src="http://standardsurvival.com/faces/64/drusz.png">', $output); } return $output; } echo OhYea2GunNukesSpamUsingDruszAvatarAndLotsOfHardcodedCrapYOLOSWAGHeyKarlSupMan('a spammy one: <img src="http://www.a-xxx-site-with-spam.com/test1.jpg">\n'); echo ""; echo OhYea2GunNukesSpamUsingDruszAvatarAndLotsOfHardcodedCrapYOLOSWAGHeyKarlSupMan('a legit one: <img src="http://www.google.com/test1.jpg">'); echo OhYea2GunNukesSpamUsingDruszAvatarAndLotsOfHardcodedCrapYOLOSWAGHeyKarlSupMan('another legit: <img src="http://www.domain.com/test1.jpg">'); echo OhYea2GunNukesSpamUsingDruszAvatarAndLotsOfHardcodedCrapYOLOSWAGHeyKarlSupMan('a spammy: <img src="http://visual.merriam-webster.com/test1.jpg">'); echo OhYea2GunNukesSpamUsingDruszAvatarAndLotsOfHardcodedCrapYOLOSWAGHeyKarlSupMan('a legit: <img src="http://www.example.com/test1.jpg">');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sX78o
function name:  (null)
number of ops:  22
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   INIT_FCALL                                               'ohyea2gunnukesspamusingdruszavatarandlotsofhardcodedcrapyoloswagheykarlsupman'
          1        SEND_VAL                                                 'a+spammy+one%3A+%3Cimg+src%3D%22http%3A%2F%2Fwww.a-xxx-site-with-spam.com%2Ftest1.jpg%22%3E%5Cn'
          2        DO_FCALL                                      0  $0      
          3        ECHO                                                     $0
   18     4        ECHO                                                     ''
   19     5        INIT_FCALL                                               'ohyea2gunnukesspamusingdruszavatarandlotsofhardcodedcrapyoloswagheykarlsupman'
          6        SEND_VAL                                                 'a+legit+one%3A+%3Cimg+src%3D%22http%3A%2F%2Fwww.google.com%2Ftest1.jpg%22%3E'
          7        DO_FCALL                                      0  $1      
          8        ECHO                                                     $1
   20     9        INIT_FCALL                                               'ohyea2gunnukesspamusingdruszavatarandlotsofhardcodedcrapyoloswagheykarlsupman'
         10        SEND_VAL                                                 'another+legit%3A+%3Cimg+src%3D%22http%3A%2F%2Fwww.domain.com%2Ftest1.jpg%22%3E'
         11        DO_FCALL                                      0  $2      
         12        ECHO                                                     $2
   21    13        INIT_FCALL                                               'ohyea2gunnukesspamusingdruszavatarandlotsofhardcodedcrapyoloswagheykarlsupman'
         14        SEND_VAL                                                 'a+spammy%3A+%3Cimg+src%3D%22http%3A%2F%2Fvisual.merriam-webster.com%2Ftest1.jpg%22%3E'
         15        DO_FCALL                                      0  $3      
         16        ECHO                                                     $3
   22    17        INIT_FCALL                                               'ohyea2gunnukesspamusingdruszavatarandlotsofhardcodedcrapyoloswagheykarlsupman'
         18        SEND_VAL                                                 'a+legit%3A+%3Cimg+src%3D%22http%3A%2F%2Fwww.example.com%2Ftest1.jpg%22%3E'
         19        DO_FCALL                                      0  $4      
         20        ECHO                                                     $4
         21      > RETURN                                                   1

Function ohyea2gunnukesspamusingdruszavatarandlotsofhardcodedcrapyoloswagheykarlsupman:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 19
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 19
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
filename:       /in/sX78o
function name:  OhYea2GunNukesSpamUsingDruszAvatarAndLotsOfHardcodedCrapYOLOSWAGHeyKarlSupMan
number of ops:  22
compiled vars:  !0 = $input, !1 = $blacklist, !2 = $output, !3 = $a_blacklisted
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    5     1        ASSIGN                                                   !1, <array>
    7     2        ASSIGN                                                   !2, !0
    9     3      > FE_RESET_R                                       $6      !1, ->19
          4    > > FE_FETCH_R                                               $6, !3, ->19
   11     5    >   INIT_FCALL                                               'preg_replace'
          6        INIT_FCALL                                               'str_replace'
          7        SEND_VAL                                                 '.'
          8        SEND_VAL                                                 '%5C.'
          9        SEND_VAR                                                 !3
         10        DO_ICALL                                         $7      
         11        CONCAT                                           ~8      '%2F%3Cimg%28.%2A%3F%29src%3D.http%28.%2A%3F%29', $7
         12        CONCAT                                           ~9      ~8, '%28.%2A%3F%29%3E%2F'
         13        SEND_VAL                                                 ~9
         14        SEND_VAL                                                 '%3Cimg+src%3D%22http%3A%2F%2Fstandardsurvival.com%2Ffaces%2F64%2Fdrusz.png%22%3E'
         15        SEND_VAR                                                 !2
         16        DO_ICALL                                         $10     
         17        ASSIGN                                                   !2, $10
    9    18      > JMP                                                      ->4
         19    >   FE_FREE                                                  $6
   14    20      > RETURN                                                   !2
   15    21*     > RETURN                                                   null

End of function ohyea2gunnukesspamusingdruszavatarandlotsofhardcodedcrapyoloswagheykarlsupman

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.41 ms | 1403 KiB | 22 Q