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')); var_dump(realpath($tmp.'/link2'));
based on OgNXL
Output for 5.3.18 - 5.3.29, 5.5.24, 5.6.7, 5.6.28, 7.0.20 - 7.2.0
Warning: unlink(/tmp/file): No such file or directory in /in/v3uns on line 5 Warning: unlink(/tmp/link1): No such file or directory in /in/v3uns on line 6 Warning: unlink(/tmp/link2): No such file or directory in /in/v3uns on line 7 string(10) "/tmp/link1" string(9) "/tmp/file"
Output for 5.4.2 - 5.4.45, 5.5.25 - 5.5.35, 5.6.8 - 5.6.21, 7.0.0 - 7.0.6
string(10) "/tmp/link1" string(9) "/tmp/file"