3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php var_dump( is_dir('/root') ); var_dump( getcwd() ); var_dump( chdir('/root') ); var_dump( getcwd() );
based on f9Xje
Output for 7.3.0rc3
Warning: is_dir(): open_basedir restriction in effect. File(/root) is not within the allowed path(s): (/tmp:/in:/etc) in /in/mpZAM on line 3 bool(false) string(1) "/" Warning: chdir(): open_basedir restriction in effect. File(/root) is not within the allowed path(s): (/tmp:/in:/etc) in /in/mpZAM on line 6 bool(false) string(1) "/"
Output for 5.2.3 - 7.1.7, 7.2.0, 7.3.0alpha1 - 7.3.0beta1
bool(true) string(1) "/" Warning: chdir(): Permission denied (errno 13) in /in/mpZAM on line 6 bool(false) string(1) "/"
Output for 7.1.20, 7.2.5 - 7.2.6
Warning: is_dir(): open_basedir restriction in effect. File(/root) is not within the allowed path(s): (/tmp:/in) in /in/mpZAM on line 3 bool(false) string(1) "/" Warning: chdir(): open_basedir restriction in effect. File(/root) is not within the allowed path(s): (/tmp:/in) in /in/mpZAM on line 6 bool(false) string(1) "/"
Output for 4.3.2 - 5.2.2
bool(true) string(3) "/in" Warning: chdir(): Permission denied (errno 13) in /in/mpZAM on line 6 bool(false) string(3) "/in"
Output for 4.3.0 - 4.3.1
bool(true) string(3) "/in" Warning: chdir() [http://www.php.net/function.chdir]: Permission denied (errno 13) in /in/mpZAM on line 6 bool(false) string(3) "/in"