3v4l.org

run code in 300+ PHP versions simultaneously
<?php mkdir(sys_get_temp_dir() . '/foo/bar', 0777, true); mkdir(sys_get_temp_dir() . '/src/Dir', 0777, true); file_put_contents(sys_get_temp_dir() . '/src/Dir/Test.php', '<?php echo "Included\n";'); include sys_get_temp_dir() . '/src/Dir/Test.php'; include_once sys_get_temp_dir() . '/foo/bar/../../src/Dir/Test.php';
Output for 5.2.1 - 5.2.17, 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.30, 7.0.0 - 7.0.20, 7.1.0 - 7.1.27, 7.1.29 - 7.1.33, 7.2.0 - 7.2.13, 7.2.18 - 7.2.22, 7.2.29 - 7.2.33, 7.3.0 - 7.3.3, 7.3.5 - 7.3.10, 7.3.16 - 7.3.31, 7.4.0 - 7.4.25, 8.0.0 - 8.0.12, 8.0.30, 8.1.21 - 8.1.28, 8.2.8 - 8.2.18, 8.3.0 - 8.3.4, 8.3.6
Included
Output for 8.3.5
Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0 Included
Output for 8.0.18, 8.0.21, 8.1.16, 8.2.3 - 8.2.7
Warning: mkdir(): File exists in /in/UMnZD on line 3 Warning: mkdir(): File exists in /in/UMnZD on line 4 Included Warning: include_once(): open_basedir restriction in effect. File(/tmp/foo/bar/../../src/Dir/Test.php) is not within the allowed path(s): (/tmp:/in:/etc) in /in/UMnZD on line 9 Warning: include_once(/tmp/foo/bar/../../src/Dir/Test.php): Failed to open stream: Operation not permitted in /in/UMnZD on line 9 Warning: include_once(): Failed opening '/tmp/foo/bar/../../src/Dir/Test.php' for inclusion (include_path='.:') in /in/UMnZD on line 9
Output for 8.0.14, 8.0.16 - 8.0.17, 8.0.20, 8.0.24, 8.0.27, 8.0.29, 8.1.0 - 8.1.8, 8.1.10 - 8.1.14, 8.1.20, 8.2.0 - 8.2.2
Warning: mkdir(): open_basedir restriction in effect. File(/tmp/foo/bar) is not within the allowed path(s): (/tmp:/in:/etc) in /in/UMnZD on line 3 Warning: mkdir(): File exists in /in/UMnZD on line 4 Included Warning: include_once(): open_basedir restriction in effect. File(/tmp/foo/bar/../../src/Dir/Test.php) is not within the allowed path(s): (/tmp:/in:/etc) in /in/UMnZD on line 9 Warning: include_once(/tmp/foo/bar/../../src/Dir/Test.php): Failed to open stream: Operation not permitted in /in/UMnZD on line 9 Warning: include_once(): Failed opening '/tmp/foo/bar/../../src/Dir/Test.php' for inclusion (include_path='.:') in /in/UMnZD on line 9
Output for 7.2.17, 7.2.23, 7.2.25, 7.3.4, 7.3.12, 7.4.26, 7.4.28 - 7.4.32, 8.0.15, 8.0.19, 8.0.22 - 8.0.23, 8.0.25 - 8.0.26, 8.0.28, 8.1.9, 8.1.15, 8.1.17 - 8.1.19
Warning: mkdir(): File exists in /in/UMnZD on line 3 Warning: mkdir(): File exists in /in/UMnZD on line 4 Included
Output for 8.0.13
Warning: mkdir(): Permission denied in /in/UMnZD on line 3 Warning: mkdir(): File exists in /in/UMnZD on line 4 Included
Output for 7.3.32 - 7.3.33, 7.4.33
Warning: mkdir(): Not a directory in /in/UMnZD on line 3 Warning: mkdir(): File exists in /in/UMnZD on line 4 Included Warning: include_once(/tmp/foo/bar/../../src/Dir/Test.php): failed to open stream: No such file or directory in /in/UMnZD on line 9 Warning: include_once(): Failed opening '/tmp/foo/bar/../../src/Dir/Test.php' for inclusion (include_path='.:') in /in/UMnZD on line 9
Output for 7.4.27
Warning: mkdir(): open_basedir restriction in effect. File(/tmp/foo/bar) is not within the allowed path(s): (/tmp:/in:/etc) in /in/UMnZD on line 3 Warning: mkdir(): File exists in /in/UMnZD on line 4 Included Warning: include_once(): open_basedir restriction in effect. File(/tmp/foo/bar/../../src/Dir/Test.php) is not within the allowed path(s): (/tmp:/in:/etc) in /in/UMnZD on line 9 Warning: include_once(/tmp/foo/bar/../../src/Dir/Test.php): failed to open stream: Operation not permitted in /in/UMnZD on line 9 Warning: include_once(): Failed opening '/tmp/foo/bar/../../src/Dir/Test.php' for inclusion (include_path='.:') in /in/UMnZD on line 9
Output for 7.3.11
Warning: mkdir(): File exists in /in/UMnZD on line 3 Included
Output for 7.2.24
Warning: mkdir(): File exists in /in/UMnZD on line 3 Warning: mkdir(): File exists in /in/UMnZD on line 4 Warning: file_put_contents(/tmp/src/Dir/Test.php): failed to open stream: No such file or directory in /in/UMnZD on line 6 Warning: include(/tmp/src/Dir/Test.php): failed to open stream: No such file or directory in /in/UMnZD on line 8 Warning: include(): Failed opening '/tmp/src/Dir/Test.php' for inclusion (include_path='.:') in /in/UMnZD on line 8 Warning: include_once(/tmp/foo/bar/../../src/Dir/Test.php): failed to open stream: No such file or directory in /in/UMnZD on line 9 Warning: include_once(): Failed opening '/tmp/foo/bar/../../src/Dir/Test.php' for inclusion (include_path='.:') in /in/UMnZD on line 9
Output for 7.1.28
Warning: mkdir(): File exists in /in/UMnZD on line 3 Warning: mkdir(): File exists in /in/UMnZD on line 4 Included Warning: include_once(/tmp/foo/bar/../../src/Dir/Test.php): failed to open stream: No such file or directory in /in/UMnZD on line 9 Warning: include_once(): Failed opening '/tmp/foo/bar/../../src/Dir/Test.php' for inclusion (include_path='.:') in /in/UMnZD on line 9
Output for 5.0.0 - 5.0.5, 5.1.0 - 5.1.6, 5.2.0
Fatal error: Call to undefined function sys_get_temp_dir() in /in/UMnZD on line 3
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: sys_get_temp_dir() in /in/UMnZD on line 3
Process exited with code 255.
Output for 4.3.2 - 4.3.11, 4.4.0 - 4.4.4
Fatal error: Call to undefined function: sys_get_temp_dir() in /in/UMnZD on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: sys_get_temp_dir() in /in/UMnZD on line 3

preferences:
287.25 ms | 401 KiB | 413 Q