3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function set($value) { error_reporting(E_ALL); print("Trying to set $value..."); $before = ini_get("open_basedir"); $result = ini_set('open_basedir', $value); if ($result) { print("Success!\n"); } else { print("Failure\n"); print(error_get_last()); } print($before." => ".ini_get('open_basedir')."\n"); } set('/tmp/a'.PATH_SEPARATOR.'/tmp/b/c'); set('/tmp/a/b'); set('/tmp/c');
based on ViiJY
Output for 5.4.34 - 5.5.26, 5.5.29 - 5.5.32, 5.5.35 - 5.6.10, 5.6.13 - 5.6.17, 5.6.21 - 5.6.28, 7.0.0 - 7.0.1, 7.0.3 - 7.1.0
Trying to set /tmp/a:/tmp/b/c...Failure => /tmp/a:/tmp/b/c Trying to set /tmp/a/b...Failure /tmp/a:/tmp/b/c => /tmp/a:/tmp/b/c Trying to set /tmp/c...Failure /tmp/a:/tmp/b/c => /tmp/a:/tmp/b/c
Output for 5.5.27 - 5.5.28, 5.5.33 - 5.5.34, 5.6.11 - 5.6.12, 5.6.18 - 5.6.20, hhvm-3.10.0 - 3.12.0, 7.0.2
Trying to set /tmp/a:/tmp/b/c...Failure => /tmp/a:/tmp/b/c Trying to set /tmp/a/b...Success! /tmp/a:/tmp/b/c => /tmp/a/b Trying to set /tmp/c...Failure /tmp/a/b => /tmp/a/b
Output for 5.4.0 - 5.4.32
Trying to set /tmp/a:/tmp/b/c... Warning: ini_set() has been disabled for security reasons in /in/Lgpja on line 7 Failure Notice: Array to string conversion in /in/Lgpja on line 12 Array => Trying to set /tmp/a/b... Warning: ini_set() has been disabled for security reasons in /in/Lgpja on line 7 Failure Notice: Array to string conversion in /in/Lgpja on line 12 Array => Trying to set /tmp/c... Warning: ini_set() has been disabled for security reasons in /in/Lgpja on line 7 Failure Notice: Array to string conversion in /in/Lgpja on line 12 Array =>
Output for 5.2.0 - 5.3.29
Trying to set /tmp/a:/tmp/b/c... Warning: ini_set() has been disabled for security reasons in /in/Lgpja on line 7 Failure Array => Trying to set /tmp/a/b... Warning: ini_set() has been disabled for security reasons in /in/Lgpja on line 7 Failure Array => Trying to set /tmp/c... Warning: ini_set() has been disabled for security reasons in /in/Lgpja on line 7 Failure Array =>
Output for 5.0.0 - 5.1.6
Trying to set /tmp/a:/tmp/b/c... Warning: ini_set() has been disabled for security reasons in /in/Lgpja on line 7 Failure Fatal error: Call to undefined function error_get_last() in /in/Lgpja on line 12
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Trying to set /tmp/a:/tmp/b/c... Warning: ini_set() has been disabled for security reasons in /in/Lgpja on line 7 Failure Fatal error: Call to undefined function: error_get_last() in /in/Lgpja on line 12
Process exited with code 255.
Output for 4.3.5 - 4.4.4
Trying to set /tmp/a:/tmp/b/c... Warning: ini_set() has been disabled for security reasons in /in/Lgpja on line 7 Failure Fatal error: Call to undefined function: error_get_last() in /in/Lgpja on line 12
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Trying to set /tmp/a:/tmp/b/c... Warning: ini_set,pcntl_fork() has been disabled for security reasons in /in/Lgpja on line 7 Failure Fatal error: Call to undefined function: error_get_last() in /in/Lgpja on line 12
Process exited with code 255.
Output for 4.3.1
Trying to set /tmp/a:/tmp/b/c... Warning: ini_set,pcntl_fork() has been disabled for security reasons in /in/Lgpja on line 7 Failure Fatal error: Call to undefined function: error_get_last() in /in/Lgpja on line 12
Output for 4.3.0
Trying to set /tmp/a:/tmp/b/c...Failure Fatal error: Call to undefined function: error_get_last() in /in/Lgpja on line 12