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'); symlink($root.'/link1', $root.'/link2'); var_dump(readlink($root.'/link2'));
based on 73UYE
Output for 5.3.18 - 5.3.25, 5.3.27 - 5.3.29, 5.4.7, 5.5.24, 5.5.29, 5.5.32 - 5.6.7, 5.6.10, 5.6.12 - 5.6.13, 5.6.18 - 5.6.19, 5.6.21 - 7.0.1, 7.0.4 - 7.0.5, 7.0.20 - 7.2.0
string(20) "/tmp/workspace/link1"
Output for 5.4.2 - 5.4.6, 5.4.8 - 5.4.45, 5.5.25 - 5.5.28, 5.5.30 - 5.5.31, 5.6.8 - 5.6.9, 5.6.11, 5.6.14 - 5.6.17, 5.6.20, 7.0.2 - 7.0.3, 7.0.6
Warning: mkdir(): File exists in /in/FrCOd on line 6 Warning: symlink(): File exists in /in/FrCOd on line 9 Warning: symlink(): File exists in /in/FrCOd on line 10 string(20) "/tmp/workspace/link1"
Output for 5.3.26
Warning: mkdir(): File exists in /in/FrCOd on line 6 Warning: symlink(): File exists in /in/FrCOd on line 9 string(20) "/tmp/workspace/link1"