1--TEST--
2Test realpath() with relative paths
3--FILE--
4<?php
5$file_path = __DIR__;
6@mkdir("$file_path/realpath_basic4/home/test", 0777, true);
7@symlink("$file_path/realpath_basic4/home", "$file_path/realpath_basic4/link1");
8@symlink("$file_path/realpath_basic4/link1", "$file_path/realpath_basic4/link2");
9echo "1. " . realpath("$file_path/realpath_basic4/link2") . "\n";
10echo "2. " . realpath("$file_path/realpath_basic4/link2/test") . "\n";
11?>
12--CLEAN--
13<?php
14$file_path = __DIR__;
15if (PHP_OS_FAMILY == 'Windows') {
16    rmdir("$file_path/realpath_basic4/link2");
17    rmdir("$file_path/realpath_basic4/link1");
18} else {
19    unlink("$file_path/realpath_basic4/link2");
20    unlink("$file_path/realpath_basic4/link1");
21}
22rmdir("$file_path/realpath_basic4/home/test");
23rmdir("$file_path/realpath_basic4/home");
24rmdir("$file_path/realpath_basic4");
25?>
26--EXPECTF--
271. %s%erealpath_basic4%ehome
282. %s%erealpath_basic4%ehome%etest
29