Newsgroups: php.internals,php.internals Path: news.php.net Xref: news.php.net php.internals:130991 php.internals:130992 X-Original-To: internals@lists.php.net Delivered-To: internals@lists.php.net Received: by lists.php.net (Postfix, from userid 65534) id 849BA1A00BD; Sat, 23 May 2026 17:21:23 +0000 (UTC) To: internals@lists.php.net,internals@lists.php.net Message-ID: Date: Sat, 23 May 2026 19:21:22 +0200 Precedence: list list-help: list-unsubscribe: list-post: List-Id: x-ms-reactions: disallow MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PHP-DEV] Proposal for 2 new magic constants Content-Language: en-GB References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Posted-By: 86.92.4.88 From: jordikroon@me.com (Jordi Kroon) On 23/05/2026 6:38 pm, php@s22.us wrote: > I would like to propose two new magic constants to PHP: __HOME__ and > __USER__ I strongly oppose this idea. This kind of information is environment-specific and does not really belong as a language-level magic constant. Existing magic constants describe source context (`__FILE__`, `__DIR__`, etc.), not host or user environment details. For CLI usage, this information is usually already available through environment variables such as `HOME` and `USER`, which is the more appropriate place for this kind of information. In isolated environments such as containers or chroots, exposing user or home-directory information is also something we generally should avoid. More importantly, I think we should discourage PHP web applications from reaching into other parts of the system and instead encourage them to stay within their application/web directories. > P.S.  Hopefully I'm posting this to the correct list.  If not, please > point me to where I need to be. This is the correct list. Often before starting an official RFC an e-mail is sent to this mailing list to see if a certain topic/idea has interest. -- Regards, Jordi Kroon