3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $d1="."; $d2="tmp"; $d3 = "in"; if ( file_exists("/etc/hosts") ){ echo "This is a linux system\n"; if(is_callable("system")){ echo "System is available\n"; $f=scandir($d1); $f1=scandir($d2); $f2= print_r($d1);print_r($d2); }elseif(is_callable("shell_exec")){ echo "Shell_exec is available\n"; }elseif(is_callable("exec")){ echo "exec is available\n"; }else{ echo "No dice:(";} }else{ echo "blah!\n\n"; } ?>
based on lDPhU
Output for 5.5.24 - 7.2.0
This is a linux system System is available Warning: scandir(.): failed to open dir: Permission denied in /in/B1bKd on line 9 Warning: scandir(): (errno 13): Permission denied in /in/B1bKd on line 9 .tmp
Output for 5.2.3 - 5.4.45
This is a linux system System is available .tmp
Output for 5.0.0 - 5.2.2
This is a linux system System is available Warning: scandir(.): failed to open dir: Permission denied in /in/B1bKd on line 9 Warning: scandir(): (errno 13): Permission denied in /in/B1bKd on line 9 Warning: scandir(tmp): failed to open dir: No such file or directory in /in/B1bKd on line 9 Warning: scandir(): (errno 2): No such file or directory in /in/B1bKd on line 9 .tmp
Output for 4.4.5 - 4.4.9
This is a linux system System is available Fatal error: Call to undefined function: scandir() in /in/B1bKd on line 9
Process exited with code 255.
Output for 4.3.2 - 4.4.4
This is a linux system System is available Fatal error: Call to undefined function: scandir() in /in/B1bKd on line 9
Process exited with code 255.
Output for 4.3.0 - 4.3.1
This is a linux system System is available Fatal error: Call to undefined function: scandir() in /in/B1bKd on line 9