3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $dir="."; if ( file_exists("/etc/hosts") ){ echo "This is a linux system\n"; if(is_callable("system")){ echo "System is available\n"; $files=scandir($dir); print_r($files); }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 sW9vP
Output for 5.0.0 - 7.2.0
This is a linux system System is available Warning: scandir(.): failed to open dir: Permission denied in /in/bqgVd on line 5 Warning: scandir(): (errno 13): Permission denied in /in/bqgVd on line 5
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/bqgVd on line 5
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/bqgVd on line 5
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/bqgVd on line 5