3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function test() {echo "THIS SHOULD NOT BE SEEN!!\n";} function ryat($a) {var_dump($a);} $str = "', test(), '"; echo "\npreg_replace()\n"; //var_dump(preg_replace('/^(.*)$/e', "ryat('\\1')", $str)); var_dump(preg_replace_callback('/^(.*)$/', "ryat", $str));
based on iMqei
Output for 4.3.0 - 5.6.28, hhvm-3.12.0, 7.0.0 - 7.1.0
preg_replace() array(2) { [0]=> string(12) "', test(), '" [1]=> string(12) "', test(), '" } string(0) ""
Output for hhvm-3.10.0

Process exited with code 153.