3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php //include('/etc/profile'); $myfile = fopen("/tmp/test.txt", "w") or die("Unable to open file!"); $txt = "John Doe\n"; fwrite($myfile, $txt); $txt = "Jane Doe\n"; fwrite($myfile, $txt); fclose($myfile); echo exec("echo "test" > /tmp/hacked.txt"); $dir = '/tmp/'; $files1 = scandir($dir); $files2 = scandir($dir, 1); print_r($files1); print_r($files2);
Output for 7.0.0 - 7.2.9
Parse error: syntax error, unexpected 'test' (T_STRING), expecting ',' or ')' in /in/os1ns on line 10
Process exited with code 255.
Output for hhvm-3.22.0
Fatal error: Uncaught Error: syntax error, unexpected T_STRING, expecting ')' in /in/os1ns:-1 Stack trace: #0 {main}
Process exited with code 255.
Output for hhvm-3.15.4 - 3.21.3
Fatal error: Uncaught Error: syntax error, unexpected T_STRING, expecting ')' in /in/os1ns:10 Stack trace: #0 {main}
Process exited with code 255.
Output for 5.6.30
Parse error: syntax error, unexpected 'test' (T_STRING) in /in/os1ns on line 10
Process exited with code 255.