Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Creates a symbolic link
<?php symlink(string $target, string $link): bool
<?php         $relativePath = $this->findShortestPath($link, $target);

        chdir(\dirname($link));

        $result = @symlink($relativePath, $link);



        chdir($cwd);
<?php         @mkdir($basepath . "/real", 0777, true);

        touch($basepath . "/real/FILE");



        $result = @symlink($basepath . "/real", $symlinked);



        if (!$result) {

            $this->markTestSkipped('Symbolic links for directories not supported on this platform');
<?php         $symlinked = $this->workingDir . "/linked";

        $symlinkedTrailingSlash = $symlinked . "/";



        $result = @symlink($this->workingDir . "/real", $symlinked);



        if (!$result) {

            $this->markTestSkipped('Symbolic links for directories not supported on this platform');