3v4l.org

run code in 300+ PHP versions simultaneously
<?php function test() { echo 'hi'; } $str = '\', phpinfo(), \''; preg_replace('/^(.*)$/e', 'test(\'\1\')', $str);

preferences:
42.59 ms | 402 KiB | 5 Q