Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:125221 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 qa.php.net (Postfix) with ESMTPS id D9AF81A00BD for ; Sun, 25 Aug 2024 16:06:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1724602073; bh=A1mJA95+/8spZ9aNfVDAJskmFQtbrVpxCOvs8aaMRq8=; h=Date:Subject:To:References:From:In-Reply-To:From; b=BqsnODTDBzd9GoAOauRzYmnQ1Hp8j8FSyWuDorIIIL+4izQAH37hrEtzR7AbGLD+R lMoh3aYmeQ9UsP/9RRqbTlurSkAof3eefT7ym6leb/d56pxl0oM/W8HUE4iP54xucX o3LvZAhJWsM1Klt/ZuZznxcHxCKwS5FjGCMBU7COWjynpCfWvKHpJDg1S2xEiXilRx VibE7FZV3hXYsvaXCqmZcU0m1cK+e3oACBoJ2qt4U5D4J6l6Gv2dpu/hE7odGJXxmz gMn0n8ZJ3av2bvpunhzFP1bmapTaCwbVjVmKh44zA5X2WimQ65TUBNT+DiHiVj4sV9 zFe4nxPrzO/AA== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 033B918006D for ; Sun, 25 Aug 2024 16:07:53 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) 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_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from fout1-smtp.messagingengine.com (fout1-smtp.messagingengine.com [103.168.172.144]) (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 ; Sun, 25 Aug 2024 16:07:52 +0000 (UTC) Received: from phl-compute-05.internal (phl-compute-05.nyi.internal [10.202.2.45]) by mailfout.nyi.internal (Postfix) with ESMTP id E1EF8138FC31 for ; Sun, 25 Aug 2024 12:05:59 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-05.internal (MEProxy); Sun, 25 Aug 2024 12:05:59 -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=fm1; t=1724601959; x=1724688359; bh=HM+l7Agx8IHi3SFFUVXImhOwagFeYXbVyURTt9ugp2E=; b= sp90mCyxOOb+OEqVCXLLxZDpQNeNWe63ZW97cQtYIOO79KcCJYzp0BlFIZUW/f+f +SFU8BG5Y8NBxviBxyJ6UirbvpNIj3nQukXH7syAd64Jo3Qw764fzkMGxhXIx94+ R+qqZPnwCNnDTLGj4aAFC3uL7e4LPw+jIgXnH4eCAWsIEnH71rZc5+lQuMRwW4yC suJ6+VrkkyxbbdfSV3ZZnNK7Hsms8YQOKHnF3MN0oHEX980hiBaw+GjkWO2UxgXH xGSQFCDapNb8u898BhwDi0+wsfwzsZpLJJVNt1SKSE0zY+oY274Ky/n4gQyoR4rL b2Nwvf4O+yg8/tKqO/WEkw== 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-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1724601959; x= 1724688359; bh=HM+l7Agx8IHi3SFFUVXImhOwagFeYXbVyURTt9ugp2E=; b=j EJJlaz2vxLPywnwb6d8gXXtIrT0NpGBensr1OfCYP8GhCWVbvQ/Nw1orHSdmprBi GaimRIPwd6bDbg5sUgC2u8Gnb9nudGkGjkr2tpJltT/KqFB+ibY3URGml8QR2Sqr Js3pwtquyhXPP9+3b5TSk60fUFrvTSYRbZsaywcJfT7vZWpjEa5bAhuy+xE+9eJk QepfWvbJYE7cOCNRj0kPMAySreKC8gqOXC7bbBmtMXNckjPSqqOo7wRtiMXTXQuT tnLXPX8NYiDqIn+BC2/mWYOltqXpbpO12qjHvNYb8DKh535jhPqDtXS2zKPm2hzx oRCpv00lgdq93dYffjhLQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddruddviedgleehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucenucfjughrpefkffggfg fuvfhfhfgjtgfgsehtjeertddtvdejnecuhfhrohhmpedftfhofigrnhcuvfhomhhmihhn shculgfkoffuohfrngdfuceoihhmshhophdrphhhphesrhifvggtrdgtohdruhhkqeenuc ggtffrrghtthgvrhhnpefhleelteekveffgeeileetgffgvdelfeevuefgvdekkefhvdet fedufeeiheehfeenucffohhmrghinhepphhhphdrnhgvthenucevlhhushhtvghrufhiii gvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehimhhsohhprdhphhhpsehrfigvtgdr tghordhukhdpnhgspghrtghpthhtohepuddpmhhouggvpehsmhhtphhouhhtpdhrtghpth htohepihhnthgvrhhnrghlsheslhhishhtshdrphhhphdrnhgvth X-ME-Proxy: Feedback-ID: id5114917:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Sun, 25 Aug 2024 12:05:59 -0400 (EDT) Message-ID: Date: Sun, 25 Aug 2024 17:05:54 +0100 Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PHP-DEV] [RFC] Default expression To: internals@lists.php.net References: <0c8ed5d6-5507-4c41-8d7f-05d14ba8aa4c@scriptfusion.com> <0cfd3a28-3cb0-4478-85fb-cf086d8e5c66@app.fastmail.com> <3e0d031e-256f-47cd-9a2b-dcdc760f5498@scriptfusion.com> Content-Language: en-GB In-Reply-To: <3e0d031e-256f-47cd-9a2b-dcdc760f5498@scriptfusion.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit From: imsop.php@rwec.co.uk ("Rowan Tommins [IMSoP]") On 25/08/2024 16:29, Bilge wrote: > You can write, `include(1 + 1);`, because `include()` accepts an > expression. You will get: "Failed opening '2' for inclusion". Should > we restrict that? No, because that's just how expressions work in any > context where they're allowed. I think a better comparison might be the "new in initializers" and "fetch property in const expressions" RFCs, which both forbid uses which would naturally be allowed by the grammar. The rationale in those cases was laid out in https://wiki.php.net/rfc/new_in_initializers#unsupported_positions and https://wiki.php.net/rfc/fetch_property_in_const_expressions#supporting_all_objects To pull out a point that might be overlooked at the bottom of my longer response earlier: > As the RFC points out, library authors already worry about the maintenance burden of named argument support, will they now also need to question whether someone is relying on "default + 1" having some specific effect? By saying "default can be used in any expression, as complex as the caller can imagine", we're implicitly saying "if you add a default to your function signature, that is no information a user can pull *out* as part of your API". Regards, -- Rowan Tommins [IMSoP]