<?php
$word = "die('Lalala'); 1||1/e\0";
// Slightly contrived example, but let's pretend we're
// case-normalizing a user-provided word, and forgot to
// preg_quote
$text = preg_replace('/'.$word.'/i', $word, $text);
Warning: Undefined variable $text in /in/JlE7P on line 8
Deprecated: preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /in/JlE7P on line 8
Warning: preg_replace(): NUL is not a valid modifier in /in/JlE7P on line 8
Output for 8.1.0 - 8.1.28
Warning: Undefined variable $text in /in/JlE7P on line 8
Deprecated: preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /in/JlE7P on line 8
Warning: preg_replace(): Null byte in regex in /in/JlE7P on line 8
Output for 8.0.0 - 8.0.30
Warning: Undefined variable $text in /in/JlE7P on line 8
Warning: preg_replace(): Null byte in regex in /in/JlE7P on line 8