php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #81677 realpath result is cached
Submitted: 2021-11-30 17:31 UTC Modified: 2021-12-01 10:50 UTC
Votes:3
Avg. Score:2.7 ± 0.5
Reproduced:1 of 2 (50.0%)
Same Version:0 (0.0%)
Same OS:1 (100.0%)
From: jozef dot briss at gmail dot com Assigned:
Status: Verified Package: Filesystem function related
PHP Version: 7.4.26 OS: Linux
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2021-11-30 17:31 UTC] jozef dot briss at gmail dot com
Description:
------------
Realpath function is using realpath_cache. This is not documented anywhere.


Test script:
---------------
<?php

exec("ln -nsf test1 test");
echo realpath("test") . "\n";
exec("ln -nsf test2 test");
echo realpath("test") . "\n";

Expected result:
----------------
/home/****/realpath/test1
/home/****/realpath/test2

Actual result:
--------------
/home/****/realpath/test1
/home/****/realpath/test1

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2021-12-01 10:50 UTC] cmb@php.net
-Status: Open +Status: Verified -Type: Bug +Type: Documentation Problem
 [2021-12-01 10:50 UTC] cmb@php.net
> Realpath function is using realpath_cache.

While this shouldn't be surprising, I agree that the documentation
of the realpath cache (and also the stat chache) could be
improved.
 
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Sun Nov 27 08:05:54 2022 UTC