3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php file_put_contents('/tmp/foo⇒bar.txt', 'hello, world!'); foreach (new DirectoryIterator('/tmp') as $file) { echo file_get_contents($file); }
based on 0Q7WJ
Output for 5.6.0 - 5.6.21, 5.6.23 - 5.6.28, 5.6.30 - 5.6.38, 7.0.0 - 7.1.4, 7.1.6, 7.1.8 - 7.2.11, 7.3.0rc1 - 7.3.0rc4
Warning: file_get_contents(): open_basedir restriction in effect. File(.) is not within the allowed path(s): (/tmp:/in:/etc) in /in/H4rMW on line 5 Warning: file_get_contents(.): failed to open stream: Operation not permitted in /in/H4rMW on line 5 Warning: file_get_contents(): open_basedir restriction in effect. File(..) is not within the allowed path(s): (/tmp:/in:/etc) in /in/H4rMW on line 5 Warning: file_get_contents(..): failed to open stream: Operation not permitted in /in/H4rMW on line 5 Warning: file_get_contents(): open_basedir restriction in effect. File(foo⇒bar.txt) is not within the allowed path(s): (/tmp:/in:/etc) in /in/H4rMW on line 5 Warning: file_get_contents(foo⇒bar.txt): failed to open stream: Operation not permitted in /in/H4rMW on line 5
Output for 7.3.0alpha1 - 7.3.0beta3
Warning: file_get_contents(.): failed to open stream: Permission denied in /in/H4rMW on line 5 Warning: file_get_contents(..): failed to open stream: Permission denied in /in/H4rMW on line 5 Warning: file_get_contents(foo⇒bar.txt): failed to open stream: No such file or directory in /in/H4rMW on line 5
Output for 7.1.7
Warning: file_get_contents(): open_basedir restriction in effect. File(.) is not within the allowed path(s): (/tmp:/in:/etc) in /in/H4rMW on line 5 Warning: file_get_contents(.): failed to open stream: Operation not permitted in /in/H4rMW on line 5 Warning: file_get_contents(): open_basedir restriction in effect. File(..) is not within the allowed path(s): (/tmp:/in:/etc) in /in/H4rMW on line 5 Warning: file_get_contents(..): failed to open stream: Operation not permitted in /in/H4rMW on line 5 Warning: file_get_contents(): open_basedir restriction in effect. File(foo⇒bar.txt) is not within the allowed path(s): (/tmp:/in:/etc) in /in/H4rMW on line 5 Warning: file_get_contents(foo⇒bar.txt): failed to open stream: Operation not permitted in /in/H4rMW on line 5 Warning: file_get_contents(): open_basedir restriction in effect. File(perf-23337.map) is not within the allowed path(s): (/tmp:/in:/etc) in /in/H4rMW on line 5 Warning: file_get_contents(perf-23337.map): failed to open stream: Operation not permitted in /in/H4rMW on line 5 Warning: file_get_contents(): open_basedir restriction in effect. File(perf-23336.map) is not within the allowed path(s): (/tmp:/in:/etc) in /in/H4rMW on line 5 Warning: file_get_contents(perf-23336.map): failed to open stream: Operation not permitted in /in/H4rMW on line 5
Output for 7.1.5
Warning: file_get_contents(): open_basedir restriction in effect. File(.) is not within the allowed path(s): (/tmp:/in:/etc) in /in/H4rMW on line 5 Warning: file_get_contents(.): failed to open stream: Operation not permitted in /in/H4rMW on line 5 Warning: file_get_contents(): open_basedir restriction in effect. File(..) is not within the allowed path(s): (/tmp:/in:/etc) in /in/H4rMW on line 5 Warning: file_get_contents(..): failed to open stream: Operation not permitted in /in/H4rMW on line 5 Warning: file_get_contents(): open_basedir restriction in effect. File(foo⇒bar.txt) is not within the allowed path(s): (/tmp:/in:/etc) in /in/H4rMW on line 5 Warning: file_get_contents(foo⇒bar.txt): failed to open stream: Operation not permitted in /in/H4rMW on line 5 Warning: file_get_contents(): open_basedir restriction in effect. File(perf-23343.map) is not within the allowed path(s): (/tmp:/in:/etc) in /in/H4rMW on line 5 Warning: file_get_contents(perf-23343.map): failed to open stream: Operation not permitted in /in/H4rMW on line 5
Output for hhvm-3.22.0
Warning: Permission denied in /in/H4rMW on line -1 Warning: Permission denied in /in/H4rMW on line -1 Warning: No such file or directory in /in/H4rMW on line -1 Warning: No such file or directory in /in/H4rMW on line -1 Warning: No such file or directory in /in/H4rMW on line -1 Warning: No such file or directory in /in/H4rMW on line -1
Output for hhvm-3.21.3
Warning: Permission denied in /in/H4rMW on line 5 Warning: Permission denied in /in/H4rMW on line 5 Warning: No such file or directory in /in/H4rMW on line 5 Warning: No such file or directory in /in/H4rMW on line 5 Warning: No such file or directory in /in/H4rMW on line 5 Warning: No such file or directory in /in/H4rMW on line 5
Output for hhvm-3.12.14 - 3.21.0
Warning: Permission denied in /in/H4rMW on line 5 Warning: Permission denied in /in/H4rMW on line 5 Warning: No such file or directory in /in/H4rMW on line 5
Output for 5.6.29
Warning: file_get_contents(): open_basedir restriction in effect. File(.) is not within the allowed path(s): (/tmp:/in:/etc) in /in/H4rMW on line 5 Warning: file_get_contents(.): failed to open stream: Operation not permitted in /in/H4rMW on line 5 Warning: file_get_contents(): open_basedir restriction in effect. File(..) is not within the allowed path(s): (/tmp:/in:/etc) in /in/H4rMW on line 5 Warning: file_get_contents(..): failed to open stream: Operation not permitted in /in/H4rMW on line 5 Warning: file_get_contents(): open_basedir restriction in effect. File(foo⇒bar.txt) is not within the allowed path(s): (/tmp:/in:/etc) in /in/H4rMW on line 5 Warning: file_get_contents(foo⇒bar.txt): failed to open stream: Operation not permitted in /in/H4rMW on line 5 Warning: file_get_contents(): open_basedir restriction in effect. File(perf-23359.map) is not within the allowed path(s): (/tmp:/in:/etc) in /in/H4rMW on line 5 Warning: file_get_contents(perf-23359.map): failed to open stream: Operation not permitted in /in/H4rMW on line 5
Output for 5.6.22
Warning: file_get_contents(): open_basedir restriction in effect. File(.) is not within the allowed path(s): (/tmp:/in:/etc) in /in/H4rMW on line 5 Warning: file_get_contents(.): failed to open stream: Operation not permitted in /in/H4rMW on line 5 Warning: file_get_contents(): open_basedir restriction in effect. File(..) is not within the allowed path(s): (/tmp:/in:/etc) in /in/H4rMW on line 5 Warning: file_get_contents(..): failed to open stream: Operation not permitted in /in/H4rMW on line 5 Warning: file_get_contents(): open_basedir restriction in effect. File(foo⇒bar.txt) is not within the allowed path(s): (/tmp:/in:/etc) in /in/H4rMW on line 5 Warning: file_get_contents(foo⇒bar.txt): failed to open stream: Operation not permitted in /in/H4rMW on line 5 Warning: file_get_contents(): open_basedir restriction in effect. File(perf-23376.map) is not within the allowed path(s): (/tmp:/in:/etc) in /in/H4rMW on line 5 Warning: file_get_contents(perf-23376.map): failed to open stream: Operation not permitted in /in/H4rMW on line 5