Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:130998 X-Original-To: internals@lists.php.net Delivered-To: internals@lists.php.net Received: from php-smtp4.php.net (php-smtp4.php.net [45.112.84.5]) by lists.php.net (Postfix) with ESMTPS id D884F1A00BC for ; Sat, 23 May 2026 19:00:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1779562831; bh=097WLGb//qGuKx+dEOyU38HB791g61unWHHQkFJNaMU=; h=Date:From:To:In-Reply-To:References:Subject:From; b=VlGD3gak3QtUUWZ3GlZ216VBdY6q2BeinGhvf0MV5XpGBnNAeTQwxuoQkTEOzAfpU 5nu/mdjDvEgf/na+8Mzw0/prXcsBxyJc+AUZOAbThevryZziSZ6UI7nqXRIeG5geuf 7HVeubq5zaCwFd/Qe8+UqtQtzQRaQ6f6HM+lKtByeKQys0dTUW66qgEGhaJpe1D5KA Zge70t5VZPw85tKKFiub7iD4DQkM1hTalw7irTmub6ACYiAtkTZy1DovlQsD6Acrs8 Xr4DwxNXKJBcQTnUyZzhoCyL0dJ8rrQAyTkA3gZ1FvAtE1gHjXETLqYS3YmOhasnuC Fakd4EOtxiGUg== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id F13371805F6 for ; Sat, 23 May 2026 19:00:29 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-0.1 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_MISSING,RCVD_IN_DNSWL_LOW, SPF_HELO_PASS,SPF_NONE autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: No X-Envelope-From: Received: from fout-a4-smtp.messagingengine.com (fout-a4-smtp.messagingengine.com [103.168.172.147]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Sat, 23 May 2026 19:00:28 +0000 (UTC) Received: from phl-compute-04.internal (phl-compute-04.internal [10.202.2.44]) by mailfout.phl.internal (Postfix) with ESMTP id 1F669EC0181 for ; Sat, 23 May 2026 15:00:23 -0400 (EDT) Received: from phl-imap-02 ([10.202.2.81]) by phl-compute-04.internal (MEProxy); Sat, 23 May 2026 15:00:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= garfieldtech.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to; s=fm3; t=1779562823; x=1779649223; bh=s3KlPAdmQQBp7VmY/2cP3 7VzeEgXCyfTShxRQELTXcE=; b=wJSwqTwdupnSPEQ3P6gfbfxoO8nRMS27pHEnX GImNWV9rESr052tgcpWsu/f7394czI9CmfU2B0vu8SOKvKgefik7/AnJzNEh4T9Q iAFFgQPnUrzmZo5X+Q0rpiSkhWofLwstZyW7soyblGBFKUh2idRQ4PTY4NWmdh5t bXBPMorhMGbx47xcsp6SinuiPrINR7aI487NLUNQHyW303DM/mV+eNp6lFQAVk2i uB+cfsEOUYR+/sj+9b3JysEU6YGSgTeR63lQSm1RtZmMKEP0EFHXXKeAG6ACvI37 MwYRjN5CQJDOdsWDBIA6c5gcOPk5KjRfxJFIf8yGk4sLAvQCQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; t=1779562823; x=1779649223; bh=s 3KlPAdmQQBp7VmY/2cP37VzeEgXCyfTShxRQELTXcE=; b=sYRz9+gj09C3erIoY UVri9msGXtRQeFtJQ7gPeFGy336wJ774usXAXYtH1Tc1nCJ6IfaUOazxr02QR8ca rBp5r6BMrhy/0ZnY3liRgSJGjfA7/wxsnJarWI84fMIBS0kG0A7jmTEuKvyajL7x PQ90q+Dy2H78H7HHqCozWb7KxUYPwH2ZcDzxQJajl/cB6KcXY9VkkLGQDls11L8o wxXJ4i6UL1E/pc6IeAfcD/1w9vrIToMXfPr21DAczeMad9bhhSxVeW7JvCNCpN3i 6HexYADJpM3hfcGh/6sS+0YtmmoL8kRKUzBMa2eeU7Mfd9/aX1wkH60JezhqlSKn GJl0Q== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefhedrtddtgdduheefkeegucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhepofggfffhvffkjghfufgtgfesthhqredtredtjeenucfhrhhomhepfdfnrghrrhih ucfirghrfhhivghlugdfuceolhgrrhhrhiesghgrrhhfihgvlhguthgvtghhrdgtohhmqe enucggtffrrghtthgvrhhnpeffieeivdfhvdeguddttdegteeiueegvefhteehfeeffeet udeitdehtdegjeeuieenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrih hlfhhrohhmpehlrghrrhihsehgrghrfhhivghlughtvggthhdrtghomhdpnhgspghrtghp thhtohepuddpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepihhnthgvrhhnrghlsh eslhhishhtshdrphhhphdrnhgvth X-ME-Proxy: Feedback-ID: i8414410d:Fastmail Received: by mailuser.phl.internal (Postfix, from userid 501) id D67ED70006A; Sat, 23 May 2026 15:00:22 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface Precedence: list list-help: list-unsubscribe: list-post: List-Id: x-ms-reactions: disallow MIME-Version: 1.0 X-ThreadId: ADGyuLRx_leo Date: Sat, 23 May 2026 14:00:02 -0500 To: "php internals" Message-ID: <096595f8-5cee-4717-9242-2e996f2226d8@app.fastmail.com> In-Reply-To: References: Subject: Re: [PHP-DEV] Proposal for 2 new magic constants Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: larry@garfieldtech.com ("Larry Garfield") On Sat, May 23, 2026, at 12:21 PM, Jordi Kroon wrote: > On 23/05/2026 6:38 pm, php@s22.us wrote: > >> I would like to propose two new magic constants to PHP: __HOME__ and=20 >> __USER__ > > I strongly oppose this idea. > > This kind of information is environment-specific and does not really=20 > belong as a language-level magic constant. Existing magic constants=20 > describe source context (`__FILE__`, `__DIR__`, etc.), not host or use= r=20 > environment details. > > For CLI usage, this information is usually already available through=20 > environment variables such as `HOME` and `USER`, which is the more=20 > appropriate place for this kind of information. > > In isolated environments such as containers or chroots, exposing user = or=20 > home-directory information is also something we generally should avoid. > > More importantly, I think we should discourage PHP web applications fr= om=20 > reaching into other parts of the system and instead encourage them to=20 > stay within their application/web directories. > >> P.S.=C2=A0 Hopefully I'm posting this to the correct list.=C2=A0 If n= ot, please=20 >> point me to where I need to be. > > This is the correct list. Often before starting an official RFC an=20 > e-mail is sent to this mailing list to see if a certain topic/idea has=20 > interest. > > --=20 > Regards, > > Jordi Kroon I am also -1 here, for the reasons Jordi lists. In cases where quick ac= cess to that information is relevant or useful, there are better alterna= tives to magic constants. --Larry Garfield