3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $tmp = sys_get_temp_dir(); unlink($tmp.'/file'); unlink($tmp.'/link1'); unlink($tmp.'/link2'); touch($tmp.'/file'); symlink($tmp.'/file', $tmp.'/link1'); symlink($tmp.'/link1', $tmp.'/link2'); var_dump(readlink($tmp.'/link2'));
based on s9ZdN
Output for 5.3.18 - 5.3.19, 5.3.21, 5.3.23, 5.3.25 - 5.3.29, 5.4.7, 5.5.24, 5.5.32, 5.6.7, 5.6.19, 7.0.0 - 7.0.1, 7.0.20 - 7.2.0
Warning: unlink(/tmp/file): No such file or directory in /in/OgNXL on line 5 Warning: unlink(/tmp/link1): No such file or directory in /in/OgNXL on line 6 Warning: unlink(/tmp/link2): No such file or directory in /in/OgNXL on line 7 string(10) "/tmp/link1"
Output for 5.3.20, 5.3.22, 5.3.24, 5.4.2 - 5.4.6, 5.4.8 - 5.4.45, 5.5.25 - 5.5.31, 5.5.34 - 5.5.35, 5.6.8 - 5.6.17, 5.6.20 - 5.6.21, 7.0.2 - 7.0.3, 7.0.5 - 7.0.6
string(10) "/tmp/link1"
Output for 5.5.33, 5.6.18, 7.0.4
Warning: unlink(/tmp/link1): No such file or directory in /in/OgNXL on line 6 Warning: unlink(/tmp/link2): No such file or directory in /in/OgNXL on line 7 string(10) "/tmp/link1"