Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:126957 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 660841A00BC for ; Wed, 26 Mar 2025 14:16:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1742998455; bh=mjUXgaWMx3TRjdFM8lcpug5tpAnNor2/63TJRN6UAck=; h=Date:From:To:Subject:In-Reply-To:References:From; b=YQfkS7Qk1bsjI6tsga2RNfpJY+5fdlWfzs1QtAPd50isANr+9fzoQhghGqVNX4nyt Vg42aX+s82ZX1w0+sZJlUCt1fVWYwz1zgiaBpsqk8n0+lONPiS6KDaERoPYNfwC6k3 0Qy0OBJMA0Kkh1dtj46LD6XecmMh5DdIggOJguvhCjwm5d9VH3HS1yGBfJ0ZG0uRVN CFySWzWRqDo9RLlKIZOdV/Geebb9uP1PZl+yd7hxx27/d5IH+jqLTmmeJKp2CY5jao SMdspaPh2NqkatR39Rru4rD/+g/SrJ3V2LbZlm9BLIEUuqUgp0sTnifOfyYPPagTpK HtoyvhkSHashQ== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 55CFE1801D5 for ; Wed, 26 Mar 2025 14:14:14 +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=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_MISSING,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from fhigh-a2-smtp.messagingengine.com (fhigh-a2-smtp.messagingengine.com [103.168.172.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 ; Wed, 26 Mar 2025 14:14:14 +0000 (UTC) Received: from phl-compute-10.internal (phl-compute-10.phl.internal [10.202.2.50]) by mailfhigh.phl.internal (Postfix) with ESMTP id 5951F114013B for ; Wed, 26 Mar 2025 10:16:42 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-10.internal (MEProxy); Wed, 26 Mar 2025 10:16:42 -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=1742998602; x=1743085002; bh=n4Rm0FUmLCW4zlwUHgGljyDk2vCQSmV9zk2UTNc7jfU=; b= d3aWUyL3CT7oIpeqXQAjfPkRRimpuRI7gU6dYL+koyG9xBbRNmOK0ecPr8utkSoT 27H94SkC+F7p15uRbt4stXEi6SJiMKu584SBttMT08OaFlP60r8AkFxtsNZh+G8Z 8kLk1e6FdoMfQfJDkyF9CJ4+R2DutQxtFvcbYOYXo9i3iBLQ48wnYM/Dgs4DcuC2 /sR/Bskr7JEnLsXRDiP4kF+GUb9okFc/dJrxWDZjdnJCoY+B3hD2UaNu75TSsieE 7G4feNOnTSCgEK1PVQnPB8CkwkMVYpWSBmnKGpHeuyMK6Q2quXCGOQZ/gl66XK3z +a0zL3MY/qSv0PGO1ChHdg== 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=1742998602; x=1743085002; bh=n 4Rm0FUmLCW4zlwUHgGljyDk2vCQSmV9zk2UTNc7jfU=; b=IVErFhP38JzFRhiFS flUfYAnXjewXOh+9V5d0yzGEjNw9t7aMt3iSG+vm5ub6NRyg/RWUwmkuIlLNkNHy dfK/G2LJ9jkLcq/UaCSB6Ck1umWjGBCPwuC57BOc/T2m1maXnMvhg6a2+Zj0wcW0 2LZqAEy05tpjlYP0wuCQFjnnmO6ImlnhfZX0BDAfmt1A1djHqM7THp5rEDPQLf2X T4Rs7uoUB4GL4zmCSkBvFGL7WasAhQc8UpzhIn2Vz2qmS7/eFisqZY2WyQ4HFmab 1cafdED7TaNZKFU8Usi229C73546Zw1ADSoHxSBU1lLp9THfkO5OjVcIdFQwu5R/ X97Kg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdduieehjeehucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggv pdfurfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucenucfjughrpeffhf fvufgfjghfkfggtgfgsehtqhhmtddtreejnecuhfhrohhmpedftfhofigrnhcuvfhomhhm ihhnshculgfkoffuohfrngdfuceoihhmshhophdrphhhphesrhifvggtrdgtohdruhhkqe enucggtffrrghtthgvrhhnpeehleffteeigfevudetfedugedtudevledugeeugeelheei hfehgfdtkeevvefgleenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrih hlfhhrohhmpehimhhsohhprdhphhhpsehrfigvtgdrtghordhukhdpnhgspghrtghpthht ohepuddpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepihhnthgvrhhnrghlsheslh hishhtshdrphhhphdrnhgvth X-ME-Proxy: Feedback-ID: id5114917:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Wed, 26 Mar 2025 10:16:41 -0400 (EDT) Date: Wed, 26 Mar 2025 14:15:38 +0000 To: internals@lists.php.net Subject: Re: [PHP-DEV] RFC: short and inner classes User-Agent: K-9 Mail for Android In-Reply-To: <45ec0bd6-4c65-4059-8cd1-e195f91b5b13@app.fastmail.com> References: <8a16b81c-7dab-4523-a352-76ba0cb4e771@app.fastmail.com> <9c4ac301-dfb2-49da-90e5-37a2824fc4e3@app.fastmail.com> <5b1e6d70-a1c9-455c-93d3-6b22cf1fef11@app.fastmail.com> <52d84a5b-09d3-4e42-9620-a62fb239c21e@app.fastmail.com> <09a82882-f1ee-4bdb-8a27-e46144a711f1@app.fastmail.com> <2512DF25-6B2F-4C18-8F49-17F2665ADB53@rwec.co.uk> <45ec0bd6-4c65-4059-8cd1-e195f91b5b13@app.fastmail.com> Message-ID: <2162332A-0022-4E8F-AC9D-4DD931D165D9@rwec.co.uk> Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: imsop.php@rwec.co.uk ("Rowan Tommins [IMSoP]") On 26 March 2025 00:22:47 GMT, Rob Landers wrote: > >To be clear, I'm not trying to be difficult=2E As you mentioned, these we= re all things I had to think about for nested classes too=2E I know how nes= ted classes work and why=2E How file-private would work, on the other hand,= I have put little thought into=2E You say it is obvious (to paraphrase), b= ut the devil is in the details, and there isn't much prior-art to draw from= here either=2E I think in some ways this is similar to the discussion I had with Edmond o= n the async thread - my starting assumption is that new features should be = consistent with existing ones, unless there's a good reason to make an exce= ption=2E=20 For instance, the language has various built-in types, so if we add a new = type, I would assume it will work in all the places that other types work= =2E It might be useful to ask questions like "does it need any special hand= ling as a return type?" but the answer will nearly always be "no"=2E Asking= "what behaviour should it have as a return type?" is only necessary if you= 've answered "yes" to the simpler question=2E Similarly, the language has three built-in access levels, so if we add a n= ew one, I would assume it will work in all the same places, unless there's = some specific reason to add a special case=2E >I agree, but these are all things we'd have to consider=2E I, personally,= would consider it working the other way around=2E A trait declaring filepr= ivate would only be accessible in the trait; otherwise you would have to ex= plain how fileprivate works without saying "the file it is written in" and = in a way that is easy to understand -- for the RFC + docs=2E I don't know i= f it would be useless or useful though=2E Just to be clear, my description is just how traits work today=2E The phra= se "compiler-assisted copy-and-paste" is widely used; I thought it was in t= he manual, but can't see it at a glance=2E As soon as you talk about "inher= iting from traits", you're going to be on the wrong track=2E Following the reasoning above, my thought process goes like this:=20 1) What does "private" mean in a trait? It means "copy this property / method with a private modifier by default"= =2E Access is granted to all code in the target class, not just other code= in the trait=2E 2) Can that apply to the proposed description of "fileprivate"/"samefile"? Yes=2E 3) Is there a good reason to change that meaning and make the new feature = inconsistent? I don't think so=2E Any change would mean changing the description of traits (they would no lo= nger just be copied and pasted code), and would lead to additional question= s (e=2Eg=2E what happens when the target class changes the visibility with = an "as" clause?)=2E Any inconsistent behaviour should have to clear a high bar=2E Rowan Tommins [IMSoP]