3v4l.org

run code in 300+ PHP versions simultaneously
<?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);
Output for 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
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
Output for 5.4.7 - 5.4.45, 5.5.24 - 5.5.35, 5.6.8 - 5.6.28, 7.0.0 - 7.0.20, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.31, 7.4.0 - 7.4.33
Notice: Undefined variable: text in /in/JlE7P on line 8 Warning: preg_replace(): Null byte in regex in /in/JlE7P on line 8
Output for 7.3.32 - 7.3.33
Warning: preg_replace(): Null byte in regex in /in/JlE7P on line 8
Output for 5.3.0 - 5.3.29, 5.4.0 - 5.4.6
Notice: Undefined variable: text in /in/JlE7P on line 8 Warning: Unexpected character in input: ' in /in/JlE7P(8) : regexp code on line 1 Lalala
Output for 5.0.4 - 5.0.5, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17
Notice: Undefined variable: text in /in/JlE7P on line 8 Lalala
Output for 4.3.0 - 4.3.11, 4.4.0 - 4.4.9, 5.0.0 - 5.0.3
Notice: Undefined variable: text in /in/JlE7P on line 8 Lalala

preferences:
227.28 ms | 402 KiB | 342 Q