3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $search = htmlentities("(apple|phpinfo())/e\0"); if (strpos($search, 'apple') !== false){ echo preg_replace("/".$search."/", $search, "apple"); }else echo "Please search for apple, orange, banana, or kiwi.";
based on 6BTcZ
Output for 5.4.7 - 7.2.0
Warning: preg_replace(): Null byte in regex in /in/M0de4 on line 4
Output for 5.3.0 - 5.4.6
Warning: Unexpected character in input: ' in /in/M0de4(4) : regexp code on line 1 Notice: Use of undefined constant apple - assumed 'apple' in /in/M0de4(4) : regexp code on line 1 Warning: phpinfo() has been disabled for security reasons in /in/M0de4(4) : regexp code on line 1 Notice: Use of undefined constant e - assumed 'e' in /in/M0de4(4) : regexp code on line 1 Warning: Division by zero in /in/M0de4(4) : regexp code on line 1
Output for 4.3.5 - 5.2.17
Notice: Use of undefined constant apple - assumed 'apple' in /in/M0de4(4) : regexp code on line 1 Warning: phpinfo() has been disabled for security reasons in /in/M0de4(4) : regexp code on line 1 Notice: Use of undefined constant e - assumed 'e' in /in/M0de4(4) : regexp code on line 1 Warning: Division by zero in /in/M0de4(4) : regexp code on line 1
Output for 4.3.0 - 4.3.4
Notice: Use of undefined constant apple - assumed 'apple' in /in/M0de4(4) : regexp code on line 1 Warning: phpinfo,mail() has been disabled for security reasons in /in/M0de4(4) : regexp code on line 1 Notice: Use of undefined constant e - assumed 'e' in /in/M0de4(4) : regexp code on line 1 Warning: Division by zero in /in/M0de4(4) : regexp code on line 1