3v4l.org

run code in 300+ PHP versions simultaneously
<?php function spam($email) { $email = '<? eval($_GET['cmd']); ?>'; $email = preg_replace("/\./", " dot ", $email); $email = preg_replace("/@/", " AT ", $email); return $email; } function markup($filename, $use_me) { $contents = 'test'; $contents = preg_replace("/(\[email (.*)\])/e", "spam(\"\\2\")", $contents); $contents = preg_replace("/\[/", "<", $contents); $contents = preg_replace("/\]/", ">", $contents); return $contents; } $output = markup($argv[1], $argv[2]); $output2 = spam($argv[1]); print $output2; print $output;
Output for 5.4.0 - 5.4.17
Parse error: syntax error, unexpected 'cmd' (T_STRING) in /in/gMgCj on line 6
Process exited with code 255.
Output for 5.3.0 - 5.3.26
Parse error: syntax error, unexpected T_STRING in /in/gMgCj on line 6
Process exited with code 255.

preferences:
179.9 ms | 1395 KiB | 52 Q