Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:130994 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 66F851A00BC for ; Sat, 23 May 2026 18:45:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1779561938; bh=Vwqj+774ZaYIdE/9uutdfIWiJcDKfBXqQysgxiVn9G4=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=DmI5hd+3EkZeq87CBSzg4Gjy/um2C7l2f6Dc2rUtGS9/gHdkk0f6oHPL7th2Xpxeo Yoz9mUMV5a3ck+vSETtLpB7qMXXOJRy++5XzyFVG3z0fzFnGzZjEpXPRDlrY5VI40V hm74eAAfAdFSt24xtkMw8LLIJVqkozj/twQsarTfb0SLn2kHyCkjHpYZpQIv6r8eAr tHZJPDzQKpPBLVkMGwuuFRjB/HBEJnjHhd7v9BWUglaM/6n1R7EVgKR79kc2SbsgwE 3WJ49LPAm0v0DURwvH/YuYVT3YpPVxExepsWvt6XBmwxq2Og2ZV27IjM+ie5b0EGfQ 73ZBLGyBAW6hw== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 916601801D6 for ; Sat, 23 May 2026 18:45:37 +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.6 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_MISSING,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: No X-Envelope-From: Received: from mail-vk1-f177.google.com (mail-vk1-f177.google.com [209.85.221.177]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Sat, 23 May 2026 18:45:37 +0000 (UTC) Received: by mail-vk1-f177.google.com with SMTP id 71dfb90a1353d-5771954bcd0so6022852e0c.0 for ; Sat, 23 May 2026 11:45:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1779561932; cv=none; d=google.com; s=arc-20240605; b=T/vTo3CdWnnE31YzgCAZKH0BpkacWjn+zg343IarNlmxcwuaYo+Lr4g9W2IOot/2aV tP/b5jtUuaxEiNdQZ6TduqOe8xqeEfji1m02K6aQg3l3IXF6OxNZtpwBTG84lAimRxV3 dzmjCEyzIZKAh4WyYfTwOo0lok2FLZ3Cald4cn+ZDomwO8N5LFkJl/P5QgH5mBfpEHmS 2QsQ38lUIONP4Cu2topbKYe+FrUevEJVrQIcxrKRNKJBFYQ9lKVq+q26Cd5ON+A12qbs T1Ry2DrMV2I8wTSLdudgNC9SVswR0iHqO5NzpN6GCUZdF05KS7/jqotKdFOMxkErKSNh zusQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:dkim-signature; bh=Vwqj+774ZaYIdE/9uutdfIWiJcDKfBXqQysgxiVn9G4=; fh=4p3zvzmWf9L+xW0lQilgGqFHCJg+3MHwcTWiTbiPYis=; b=SEDw/AhWcq4XaoxjldfUJJkyFyWuWaueINy0Zg4b36514UbJtwBiKOcMCKsw5OWxDR ny3Xq4Rzf1cY8GZD8Ubwu0idXa4JjH2Wrwbh4TKLTHynmTuIscdl2f1svxNK59YlX0Dl hJlE+iJlJPmc/vH7kt3MXDlGOa9zM/1vPybQEcYticy1q1iJiEYKuq1gjvg1bFk/mLPm elpIGc0mAAgaTK8mLhgkJiMHyNHYS36h3qSE7/hQxOg3ucwyKHnMT/hGlvU57VkTuwIT xMcRf8g/gztcWmfa05uksXtw4mPUj2NBCGBo8O18H2ferOhAz/lK3b2fg98QaNDLCn0u 44zg==; darn=lists.php.net ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=devilix.net; s=google; t=1779561932; x=1780166732; darn=lists.php.net; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=Vwqj+774ZaYIdE/9uutdfIWiJcDKfBXqQysgxiVn9G4=; b=cFEK4rIjuLTtS832c2eLCblWdc3K2SjQfvR40/xNJJCCO026ZPRR9bWCK44NGljWl9 h1Ppui+CQCXfyPDaf68GRx2uujSIBczpC+Ym1zG7ugHiYjhZ0MIaNZYJQ+a019HpJoiU lDKKb7nSP1SQqi86ujpkBhgJU0MtcH9Xf3Jfo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779561932; x=1780166732; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=Vwqj+774ZaYIdE/9uutdfIWiJcDKfBXqQysgxiVn9G4=; b=sP84b8OD6KDeTIkC1XRbu+bOw8aJhZnwPzASJqNfvsxTGCD/miA9kooxghAcpzDbj+ /MGEb6XwaFsX11qjOPtYQteBctlFXHTrfXdWjaX/tAnKErsjI7nYdalmGt23JTPA3yLz OaKE/FavmPdAfAKi3yy9H+YmpukK5cqVSqZ3ELQd8DF9moarN4b3iIDBtr5ce4O+S7X/ tk0xxJpbsg1ZqTeoSw8f6wmTEIUad+1AthQSdsp3r+1PT2mdkFmwiqZ4x7vbBkjrI+ej 8t0Ti/ZNnA/9DHSbFDDtuLae33x45gouM2gGGf1Lsz1ozaqLBzMXfGpbEQKZAjMqZC2x GRSA== X-Gm-Message-State: AOJu0YzUgih9On4BdQo09h7eWwp/ah6nIs8GuwoFfThLZzsWJlYYLD/f nLSp42mdpq8ZFlTnEXacUsvO/yVrmyW1lGmbegjc49bI0z58owhqTf77EMP26zWYVTgcRZkp7xC y2ftgG3l6qHBaOLnhlvd0bPXbNzNaIujaJaZOaVFF X-Gm-Gg: Acq92OGgho91tEPnBJ1SaNDuiA4/tIBHA6Tn16XhQC/vAaB6JgOdIQDpc/FG7EnvWoa 28KRSRvwnB3dUFaMRKS8vTHSBySeff5EEtDIsocXlr21Fg1tfK3GF1Oplsb6NKz/aUvg4K8N1R5 /iPDyE4PLTqTEv1QbJDbX6ZhBJ2hbOY0vzhXdi2SfbAChHqezH/FosiukpetsEJsbUjGKfAqXgc GkifTCJ9um4shz2MR4P1GiBvdW76OLCeApkFaKztkJgiehl6CYKQz4fl8zY0vqTDSn7Ln5xeLxf z8QkmPolQ3HTAsg10E+q3SoHvqxn/2FaDAKlHXhA1XSl0vDcEPU29FoA4M8Q48yDsgLp+m0U1DG o0Q== X-Received: by 2002:a05:6122:e22c:b0:56f:bb91:4861 with SMTP id 71dfb90a1353d-586595dd60bmr4923509e0c.0.1779561931622; Sat, 23 May 2026 11:45:31 -0700 (PDT) Precedence: list list-help: list-unsubscribe: list-post: List-Id: x-ms-reactions: disallow MIME-Version: 1.0 References: In-Reply-To: Date: Sat, 23 May 2026 21:45:20 +0300 X-Gm-Features: AVHnY4JBeDrnyUDTsfO-hh7cMszWyYoYieSPhJfIcRZEPqlD4g0Egy35W5EaZrk Message-ID: Subject: Re: [PHP-DEV] Proposal for 2 new magic constants To: Jordi Kroon Cc: internals@lists.php.net Content-Type: multipart/alternative; boundary="000000000000ca59f80652808cf4" From: narf@devilix.net (Andrey Andreev) --000000000000ca59f80652808cf4 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi, On Sat, May 23, 2026 at 8:23=E2=80=AFPM Jordi Kroon wro= te: > > 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. > I concur, and that settles the argument for me. However ... > 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. This default mindset of "PHP is for web and everything must conform to that" is my biggest pet peeve on this list. It would serve PHP better to not impede more general purpose use cases. Cheers, Andrey. --000000000000ca59f80652808cf4 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi,

On Sat, May 23, 2026 at 8:23= =E2=80=AFPM Jordi Kroon <jordikroon= @me.com> wrote:

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.

I concur, and that settles the argument for me. However ...
<= div>=C2=A0
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.

<= div>This default mindset of "PHP is for web and everything must confor= m to that" is my biggest pet peeve on this list. It would serve PHP be= tter to not impede more general purpose use cases.

Cheers,
Andrey.
--000000000000ca59f80652808cf4--