3v4l.org

run code in 300+ PHP versions simultaneously
<?php //initial test setup mkdir($a = sys_get_temp_dir() . '/A'); mkdir($b = sys_get_temp_dir() . '/A/B'); mkdir($c = sys_get_temp_dir() . '/A/B/C'); $template = <<<EOL <?php var_dump(__FILE__); EOL; $incTemplate = <<<EOL <?php include '../do_a.php'; include '../do_b.php'; EOL; file_put_contents($b . '/do_a.php', $template); file_put_contents($b . '/do_b.php', $template); file_put_contents($c . '/do.php', $incTemplate); ini_set('display_errors', 'on'); ini_set('error_reporting', -1); //end test setup if ($doAllThings = realpath($c . '/do.php')) { include $doAllThings; //warnings echo '---------------------' . PHP_EOL; chdir(dirname($doAllThings)); include $doAllThings; }
Output for 8.0.21, 8.0.27, 8.0.29 - 8.0.30, 8.1.21 - 8.1.33, 8.2.8 - 8.2.29, 8.3.0 - 8.3.28, 8.4.1 - 8.4.14, 8.5.0
Warning: include(): open_basedir restriction in effect. File(../do_a.php) is not within the allowed path(s): (/tmp:/in:/etc) in /tmp/A/B/C/do.php on line 2 Warning: include(../do_a.php): Failed to open stream: Operation not permitted in /tmp/A/B/C/do.php on line 2 Warning: include(): Failed opening '../do_a.php' for inclusion (include_path='.:') in /tmp/A/B/C/do.php on line 2 Warning: include(): open_basedir restriction in effect. File(../do_b.php) is not within the allowed path(s): (/tmp:/in:/etc) in /tmp/A/B/C/do.php on line 3 Warning: include(../do_b.php): Failed to open stream: Operation not permitted in /tmp/A/B/C/do.php on line 3 Warning: include(): Failed opening '../do_b.php' for inclusion (include_path='.:') in /tmp/A/B/C/do.php on line 3 --------------------- string(17) "/tmp/A/B/do_a.php" string(17) "/tmp/A/B/do_b.php"
Output for 8.4.15
/bin/php-8.4.15: /usr/lib/libm.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libm.so.6: version `GLIBC_2.35' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libc.so.6: version `GLIBC_2.34' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libc.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.4.15)
Process exited with code 1.
Output for 8.0.14 - 8.0.20, 8.0.22 - 8.0.26, 8.0.28, 8.1.0 - 8.1.20, 8.2.0 - 8.2.7
Warning: mkdir(): File exists in /in/D0Tn6 on line 5 Warning: mkdir(): File exists in /in/D0Tn6 on line 6 Warning: mkdir(): File exists in /in/D0Tn6 on line 7 Warning: include(): open_basedir restriction in effect. File(../do_a.php) is not within the allowed path(s): (/tmp:/in:/etc) in /tmp/A/B/C/do.php on line 2 Warning: include(../do_a.php): Failed to open stream: Operation not permitted in /tmp/A/B/C/do.php on line 2 Warning: include(): Failed opening '../do_a.php' for inclusion (include_path='.:') in /tmp/A/B/C/do.php on line 2 Warning: include(): open_basedir restriction in effect. File(../do_b.php) is not within the allowed path(s): (/tmp:/in:/etc) in /tmp/A/B/C/do.php on line 3 Warning: include(../do_b.php): Failed to open stream: Operation not permitted in /tmp/A/B/C/do.php on line 3 Warning: include(): Failed opening '../do_b.php' for inclusion (include_path='.:') in /tmp/A/B/C/do.php on line 3 --------------------- string(17) "/tmp/A/B/do_a.php" string(17) "/tmp/A/B/do_b.php"
Output for 8.0.0 - 8.0.13
Warning: mkdir(): File exists in /in/D0Tn6 on line 5 Warning: mkdir(): File exists in /in/D0Tn6 on line 6 Warning: mkdir(): File exists in /in/D0Tn6 on line 7 Warning: include(../do_a.php): Failed to open stream: No such file or directory in /tmp/A/B/C/do.php on line 2 Warning: include(): Failed opening '../do_a.php' for inclusion (include_path='.:') in /tmp/A/B/C/do.php on line 2 Warning: include(../do_b.php): Failed to open stream: No such file or directory in /tmp/A/B/C/do.php on line 3 Warning: include(): Failed opening '../do_b.php' for inclusion (include_path='.:') in /tmp/A/B/C/do.php on line 3 --------------------- string(17) "/tmp/A/B/do_a.php" string(17) "/tmp/A/B/do_b.php"
Output for 7.2.0 - 7.2.34, 7.3.0 - 7.3.32, 7.4.0 - 7.4.26, 7.4.33
Warning: mkdir(): File exists in /in/D0Tn6 on line 5 Warning: mkdir(): File exists in /in/D0Tn6 on line 6 Warning: mkdir(): File exists in /in/D0Tn6 on line 7 Warning: include(../do_a.php): failed to open stream: No such file or directory in /tmp/A/B/C/do.php on line 2 Warning: include(): Failed opening '../do_a.php' for inclusion (include_path='.:') in /tmp/A/B/C/do.php on line 2 Warning: include(../do_b.php): failed to open stream: No such file or directory in /tmp/A/B/C/do.php on line 3 Warning: include(): Failed opening '../do_b.php' for inclusion (include_path='.:') in /tmp/A/B/C/do.php on line 3 --------------------- string(17) "/tmp/A/B/do_a.php" string(17) "/tmp/A/B/do_b.php"
Output for 7.3.33, 7.4.27 - 7.4.29, 7.4.32
Warning: mkdir(): File exists in /in/D0Tn6 on line 5 Warning: mkdir(): File exists in /in/D0Tn6 on line 6 Warning: mkdir(): File exists in /in/D0Tn6 on line 7 Warning: include(): open_basedir restriction in effect. File(../do_a.php) is not within the allowed path(s): (/tmp:/in:/etc) in /tmp/A/B/C/do.php on line 2 Warning: include(../do_a.php): failed to open stream: Operation not permitted in /tmp/A/B/C/do.php on line 2 Warning: include(): Failed opening '../do_a.php' for inclusion (include_path='.:') in /tmp/A/B/C/do.php on line 2 Warning: include(): open_basedir restriction in effect. File(../do_b.php) is not within the allowed path(s): (/tmp:/in:/etc) in /tmp/A/B/C/do.php on line 3 Warning: include(../do_b.php): failed to open stream: Operation not permitted in /tmp/A/B/C/do.php on line 3 Warning: include(): Failed opening '../do_b.php' for inclusion (include_path='.:') in /tmp/A/B/C/do.php on line 3 --------------------- string(17) "/tmp/A/B/do_a.php" string(17) "/tmp/A/B/do_b.php"
Output for 7.4.30
Warning: include(): open_basedir restriction in effect. File(../do_a.php) is not within the allowed path(s): (/tmp:/in:/etc) in /tmp/A/B/C/do.php on line 2 Warning: include(../do_a.php): failed to open stream: Operation not permitted in /tmp/A/B/C/do.php on line 2 Warning: include(): Failed opening '../do_a.php' for inclusion (include_path='.:') in /tmp/A/B/C/do.php on line 2 Warning: include(): open_basedir restriction in effect. File(../do_b.php) is not within the allowed path(s): (/tmp:/in:/etc) in /tmp/A/B/C/do.php on line 3 Warning: include(../do_b.php): failed to open stream: Operation not permitted in /tmp/A/B/C/do.php on line 3 Warning: include(): Failed opening '../do_b.php' for inclusion (include_path='.:') in /tmp/A/B/C/do.php on line 3 --------------------- string(17) "/tmp/A/B/do_a.php" string(17) "/tmp/A/B/do_b.php"

preferences:
169.01 ms | 420 KiB | 5 Q