Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:128875 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 C8F081A00BC for ; Mon, 20 Oct 2025 18:17:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1760984245; bh=LvNHdUqtbsuXhKDHdWoTswWqaC2MYJruLrMEZB0VARo=; h=Date:Subject:To:References:From:In-Reply-To:From; b=ZStobDTvV+Pm9ueQneP8NLQfukTdWNW0dXG9G/8ew9iFmCGSaLqblABhn42pD3p7J sv9xGwu+iFSP7zKaReeMBMtwoYVhh7Bj3um3DXykpNETIiSh6F5TmxgiXwFRLPfF7j 4NOCq2NtRYzVS+TfhHDpZwopqua2oNZa5pSmRbROdDhN6ydL0ldUkzsUeT6SCgbdFE msTWo2mjn+MzifR+DpJNq/KUYUchjyNxAcn+xls2T/ql/0InFagp54cwSBxzpymYdo XxRTybzwUHh0mBJ9KqNttHtocFNqPfxXFSlPX8PI7i1inEoOaLt53hoFrdBcVL8/jJ XOYfGBDcHY4/w== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 719D4180039 for ; Mon, 20 Oct 2025 18:17:24 +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=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_MISSING,RCVD_IN_DNSWL_LOW, SPF_HELO_PASS,SPF_PASS autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: No X-Envelope-From: Received: from fhigh-b2-smtp.messagingengine.com (fhigh-b2-smtp.messagingengine.com [202.12.124.153]) (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 ; Mon, 20 Oct 2025 18:17:23 +0000 (UTC) Received: from phl-compute-01.internal (phl-compute-01.internal [10.202.2.41]) by mailfhigh.stl.internal (Postfix) with ESMTP id 58F607A0139 for ; Mon, 20 Oct 2025 14:17:18 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-01.internal (MEProxy); Mon, 20 Oct 2025 14:17:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rwec.co.uk; 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=fm2; t=1760984238; x=1761070638; bh=D8p5KF8B+L/by+sSThjD0Ccx3GVcungsd/LQHZ03UZw=; b= uY02bWRygP/2AjGgRX3NHmMjBKkousmngIPTvY4uQI6CV3cR7WE4x8n61vwTGSKY hg18fKaefl161zcPvxRuC3aQXWktdDGWl82VtBT4VdVNJU2vCmIW9nUpBWDJET/e /2UKWHrBXujMsJb4t3kPNJ+nnPbxVYDjIXe9+okvI9V8zQULuPOgYUopJ6g6MA+8 5yTj+AxIG1wIGY4m4Co3j69+AzjTurY/gl6Pp2mG/yqgFls2o5zOw18pB/QXk0Al 0+rSr5NRMC/BfZymbGoFlDbHkEYvxuuDSv6Sjy15vKgYAjjqLIo2miIPZG65CClP 9M97w6Ke59+S6MtcKsntsQ== 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=fm2; t=1760984238; x=1761070638; bh=D 8p5KF8B+L/by+sSThjD0Ccx3GVcungsd/LQHZ03UZw=; b=tEz4w2p+nY05B/J3v HH/+tgj1DueuldwsS7qvvo+oQuQdC43Cb3vmrvVf5OukMy5n1GxlN1hF/J26Wvn0 NvXV30zNk7XdxNpw/N28T/+yA9UXL+W4HqO8jdvr5dy4M9L5xrRGgv8+jMulb+J6 +9Hjg6RGVLT663Wsn5Lh9l1d3uLBmo79FCPyrgNWsqHkmTjb0u6vwlZWqp08ooTy RFAcHb38aUOHpsEhL1RS0NOhAwPQoiuW5FWFogJuQDP/SgOgupLMB3jrDp1sGYHM jvSXwvju20nxVQKuombNGLPlMn9FFcTWt0KxuxmnkPOD1tEDdQTja7Zsfj9Rje+m NVemQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdeggddufeekheduucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucenucfjughrpefkffggfgfuvfhfhfgjtgfgsehtjeertd dtvdejnecuhfhrohhmpedftfhofigrnhcuvfhomhhmihhnshculgfkoffuohfrngdfuceo ihhmshhophdrphhhphesrhifvggtrdgtohdruhhkqeenucggtffrrghtthgvrhhnpeejke fghfeugffgtdeuheeggfdugefhudekjefhteegieejleehveelhfefvdfhudenucevlhhu shhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehimhhsohhprdhphh hpsehrfigvtgdrtghordhukhdpnhgspghrtghpthhtohepuddpmhhouggvpehsmhhtphho uhhtpdhrtghpthhtohepihhnthgvrhhnrghlsheslhhishhtshdrphhhphdrnhgvth X-ME-Proxy: Feedback-ID: id5114917:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Mon, 20 Oct 2025 14:17:17 -0400 (EDT) Message-ID: <775eb41b-7d5b-4da6-8f31-834de92b4ac8@rwec.co.uk> Date: Mon, 20 Oct 2025 19:17:16 +0100 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] Deprecate Undefined Constant Usage in php.ini Files (GH-20060) Content-Language: en-GB To: internals@lists.php.net References: <2abf50cd-5738-48e0-af15-a8c010141deb@bastelstu.be> <1760945334276.4002170669.2593555531@yahoo.de> In-Reply-To: <1760945334276.4002170669.2593555531@yahoo.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit From: imsop.php@rwec.co.uk ("Rowan Tommins [IMSoP]") On 20/10/2025 10:16, Hans Krentel wrote: > So, there would indeed be a change compared to my earlier answer: I now > propose using only uppercase names for constant resolution (and thus for > the warning you asked about). This would mean: > > - Allowing unquoted strings with lowercase characters to pass through > unchanged. > > - Restricting constant name resolution to a pattern like: > > CONSTANT_NAME [A-Z_][A-Z0-9_]* > > ...possibly with a minimum length greater than one, as shown. I don't think this kind of pattern matching is the right way to go. It's perfectly normal in INI files to have all sorts of strings which aren't quoted; looking through the samples provided in the source, I spotted this: user_agent=PHP No regex is going to recognise that that should be interpreted as "PHP", not constant("PHP"). As I think I mentioned in an earlier message, the specific problem raised seems to be more to do with string-to-int conversion, rather than the INI parsing itself. Even if the invalid constant is surrounded by quotes, this is not a useful setting: error_reporting = "X_ERROR"|E_WARNING|E_PARSE|E_NOTICE Maybe the part of the parser that handles *operators* is what needs a behaviour change instead? -- Rowan Tommins [IMSoP]