3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php if ( file_exists("/etc/hosts") ){ echo "This is a linux system\n"; echo file_get_contents("/bin/ls"); }else{ echo "blah!\n\n"; } ?>
based on fVbPH
Output for 7.1.25 - 7.3.1
This is a linux system Warning: file_get_contents(): open_basedir restriction in effect. File(/bin/ls) is not within the allowed path(s): (/tmp:/in:/etc) in /in/PCm2t on line 5 Warning: file_get_contents(/bin/ls): failed to open stream: Operation not permitted in /in/PCm2t on line 5
Output for 4.3.2 - 7.1.10
This is a linux system Warning: file_get_contents(/bin/ls): failed to open stream: No such file or directory in /in/PCm2t on line 5
Output for 4.3.0 - 4.3.1
This is a linux system Warning: file_get_contents(/bin/ls) [http://www.php.net/function.file-get-contents]: failed to create stream: No such file or directory in /in/PCm2t on line 5