3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $tmp = sys_get_temp_dir(); $root = $tmp.'/workspace'; mkdir($root); touch($root.'/file'); symlink($root.'/file', $root.'/link1'); var_dump(readlink($root.'/link2'));
based on FrCOd
Output for 5.3.18 - 5.3.29, 5.5.24, 5.6.7, 5.6.28, 7.0.20 - 7.2.0
Warning: readlink(): No such file or directory in /in/s9ZdN on line 11 bool(false)
Output for 5.4.2 - 5.4.7, 5.5.25 - 5.5.35, 5.6.8 - 5.6.21, 7.0.0 - 7.0.6
Warning: mkdir(): File exists in /in/s9ZdN on line 6 Warning: symlink(): File exists in /in/s9ZdN on line 9 string(20) "/tmp/workspace/link1"
Output for 5.4.8 - 5.4.45
Warning: mkdir(): File exists in /in/s9ZdN on line 6 Warning: symlink(): File exists in /in/s9ZdN on line 9 Warning: readlink(): No such file or directory in /in/s9ZdN on line 11 bool(false)