3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $tmp = sys_get_temp_dir(); clearstatcache(); touch($tmp.'/file'); symlink($tmp.'/file', $tmp.'/link1'); symlink($tmp.'/link1', $tmp.'/link2'); var_dump(readlink($tmp.'/link2'));
based on tA5CE
Output for 5.3.18 - 5.4.34, 5.4.36, 5.4.38 - 5.4.44, 5.5.0 - 5.5.1, 5.5.3 - 5.5.4, 5.5.6 - 5.5.19, 5.5.21 - 7.0.22, 7.0.24 - 7.1.4, 7.1.6 - 7.3.0
string(10) "/tmp/link1"
Output for 5.4.35, 5.4.37, 5.4.45, 5.5.2, 5.5.5, 5.5.20, 7.0.23, 7.1.5
Warning: symlink(): File exists in /in/73UYE on line 8 Warning: symlink(): File exists in /in/73UYE on line 9 string(10) "/tmp/link1"