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
 [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

Pull Requests

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.
 [2022-11-28 03:36 UTC] ramaha256 at gmail dot com
realpath_cache is the system that allows php to cache paths to locations of files/directories you are using to minimize expensive disk lookups.
(https://www.myhtspace.org/)github.com
 [2022-12-23 10:02 UTC] janettabloomquist at gmail dot com
realpath_cache is the system that allows php to cache paths to locations of files/directories you are using to minimize expensive disk lookups. It could possibly greatly improve performance of you PHP application/site if you use alot of relative file paths PHP has to parse/lookup each time you reference them. 
(https://www.mysanfordchart.net/)github.com
 [2023-04-26 15:31 UTC] mysanfordchart dot me at gmail dot com
Exactly what I needed! You just saved me several hours. Thanks!

https://mysanfordchart.me/)github.com
 [2023-05-03 02:27 UTC] kevin120 at aol dot com
(https://www.cameo.com/jeremypiven)github.com
(https://www.facebook.com/jeremypivenpage/)github.com
(https://www.amazon.com/prime-video/actor/Jeremy-Piven/amzn1.dv.gti.785e61d6-1dd8-4777-88c4-b33c24097594)github.com
(https://pixarcars.fandom.com/wiki/Jeremy_Piven)github.com
(https://www.eonline.com/news/1371236/jeremy-piven-teases-his-idea-for-entourage-reboot)github.com
(https://www.rottentomatoes.com/celebrity/jeremy_piven)github.com
(https://twitter.com/jeremypiven)github.com
(https://www.emmys.com/bios/jeremy-piven)github.com
(https://www.blu-ray.com/Jeremy-Piven/70580/)github.com
(https://ramentertainment.com/jeremy-piven)github.com
(https://podcasts.apple.com/us/podcast/the-big-shark-jeremy-piven/id1558354780?i=1000608694599)github.com
(https://www.etonline.com/people/jeremy-piven)github.com
(https://www.ibdb.com/broadway-cast-staff/jeremy-piven-405986)github.com
(https://abcnews.go.com/GMA/Culture/video/jeremy-piven-talks-new-movie-sweetwater-98145023)github.com
(https://www.eonline.com/news/1371236/jeremy-piven-teases-his-idea-for-entourage-reboot)github.com
(https://www.youtube.com/watch?v=RtQRmT2cSAM)github.com
(https://www.instagram.com/jeremypiven/)github.com
(https://www.imdb.com/name/nm0005315/)github.com
(https://www.tvguide.com/celebrities/jeremy-piven/credits/3000397119/)github.com
(https://www.tcm.com/tcmdb/person/153053%7C174725/Jeremy-Piven#overview)github.com
(https://www.bravotv.com/watch-what-happens-live-with-andy-cohen/season-12/episode-96/videos/jeremy-pivens-mercury-poisoning)github.com
(https://www.tvinsider.com/people/jeremy-piven/)github.com
(https://en.wikipedia.org/wiki/Jeremy_Piven)github.com
(https://www.primetimer.com/item/Jeremy-Piven-to-host-celebrity-interview-podcast-How-U-Livin-J-Piven-WoSpdw)github.com
(https://www.imdb.com/name/nm0005315/news)github.com
(https://en.wikipedia.org/wiki/Jeremy_Piven)github.com
(https://www.the-sun.com/entertainment/tv/3810895/jeremy-piven-reveals-entourage-return-woke-twist-ari-gold/)github.com
(https://en.wikipedia.org/wiki/Jeremy_Piven)github.com
(https://www.imdb.com/title/tt3661590/)github.com
 [2023-05-29 08:24 UTC] myfordbenefits dot one at gmail dot com
I am also  facing the same issues and looking for a proper guidance.Maybe someone will help me as well. Thank you 
https://www.myfordbenefits.me/)github.com
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 12:01:31 2024 UTC