3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php mkdir('foo/bar', 0777, true); mkdir('src/Dir', 0777, true); file_put_contents('src/Dir/Test.php', '<?php echo "Included"'); include __DIR__ . '/src/Dir/Test.php'; include_once __DIR__ . '/foo/bar/../../src/Dir/test.php';
Output for 5.6.30, 7.0.0 - 7.2.9
Warning: mkdir(): open_basedir restriction in effect. File(/foo) is not within the allowed path(s): (/tmp:/in:/etc) in /in/JaQOI on line 3 Warning: mkdir(): open_basedir restriction in effect. File(/src) is not within the allowed path(s): (/tmp:/in:/etc) in /in/JaQOI on line 4 Warning: file_put_contents(): open_basedir restriction in effect. File(src/Dir/Test.php) is not within the allowed path(s): (/tmp:/in:/etc) in /in/JaQOI on line 6 Warning: file_put_contents(src/Dir/Test.php): failed to open stream: Operation not permitted in /in/JaQOI on line 6 Warning: include(/in/src/Dir/Test.php): failed to open stream: No such file or directory in /in/JaQOI on line 8 Warning: include(): Failed opening '/in/src/Dir/Test.php' for inclusion (include_path='.:') in /in/JaQOI on line 8 Warning: include_once(/in/foo/bar/../../src/Dir/test.php): failed to open stream: No such file or directory in /in/JaQOI on line 9 Warning: include_once(): Failed opening '/in/foo/bar/../../src/Dir/test.php' for inclusion (include_path='.:') in /in/JaQOI on line 9
Output for hhvm-3.22.0
Warning: mkdir(): Permission denied in /in/JaQOI on line -1 Warning: mkdir(): Permission denied in /in/JaQOI on line -1 Warning: No such file or directory in /in/JaQOI on line -1 Warning: include(/in/src/Dir/Test.php): File not found in /in/JaQOI on line -1 Warning: include_once(/in/foo/bar/../../src/Dir/test.php): File not found in /in/JaQOI on line -1
Output for hhvm-3.15.4 - 3.21.3
Warning: mkdir(): Permission denied in /in/JaQOI on line 3 Warning: mkdir(): Permission denied in /in/JaQOI on line 4 Warning: No such file or directory in /in/JaQOI on line 6 Warning: include(/in/src/Dir/Test.php): File not found in /in/JaQOI on line 8 Warning: include_once(/in/foo/bar/../../src/Dir/test.php): File not found in /in/JaQOI on line 9