Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:125467 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 A1EFC1A00BD for ; Sat, 7 Sep 2024 13:21:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1725715410; bh=rloeHhXUPbBAc1uP/JNF6VQcuburS65VRKzUV3aC9K0=; h=Date:From:To:In-Reply-To:References:Subject:From; b=DmojdNG4u/W6enDr7gBx4boXPEH7AiJAOx/r3gtNfqG5cUQg6DmXby8lDNiXVynMn WNurMUixPBmJpXcHctZnFzyVwUvFpTmWLCLZqPIglDkTQgb4zTnnI3fvayb2ieoxor g07gVJqTNdOiJuLj5Lk60Tq/YLuEm1Yemxa/zgGowrAPULTGLh4W3TYUJVUWzE1fqX EDbtp9hYzy9wAaIpB8g4IJ6+b21A6B/zhDz9Qm5I705b2qJqjXwwqNQKXy5bmuX50Z QvLyQMV6w7ESptG3A9Sn6N8+1z59u7ZpPtwEaysPPp7JpYVKqUD/wPvCNUxTuAB235 AQmq1HFE72kpA== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 10AA2180032 for ; Sat, 7 Sep 2024 13:23:30 +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, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_NONE autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from fhigh5-smtp.messagingengine.com (fhigh5-smtp.messagingengine.com [103.168.172.156]) (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, 7 Sep 2024 13:23:29 +0000 (UTC) Received: from phl-compute-01.internal (phl-compute-01.phl.internal [10.202.2.41]) by mailfhigh.phl.internal (Postfix) with ESMTP id A94DE11400E4 for ; Sat, 7 Sep 2024 09:21:29 -0400 (EDT) Received: from phl-imap-06 ([10.202.2.83]) by phl-compute-01.internal (MEProxy); Sat, 07 Sep 2024 09:21:29 -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=fm1; t=1725715289; x=1725801689; bh=8HVcu3SJbcCdxvxseNSPR 7SWXF8iICtObc26ITPXUFA=; b=igE1pc6dtmUvbgV3xcuCznVtsEeUx0yr7JJJD WWjHhi6v/UJDMtS3qfY0ExeSIQZbsRRUQCVfDdrccA0cL/Z6BodxzkNjkah4m79i OgldfRB8Gbh8LHyAmIpK7IlN+3hnq/QPUxyfbJLC8T8lvnWCBrXCwYHDNcyyYTHC /m4bqFDr8K9Q6ufYjbrg0NGUKYCjQu51xpdAyRBd4ZVLUbAHhQJONXre2XAu7dvP 3NBrMFXPzeDAs+NHlbStDMHvdT7f3vM8C3nA/LifiEk83DJRgDMeNSwNOf/3eeEw 9guPV0w3aX7Jh4wtzY7L4j7+ZoY3IeB+OpBlKh4U3iiaJvxMA== 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=1725715289; x= 1725801689; bh=8HVcu3SJbcCdxvxseNSPR7SWXF8iICtObc26ITPXUFA=; b=d qOqS0aRTmKF83z8cNl/c+W+dEkYPItL39yFeALUKw6HHC3msZ2F0VSfX9n2B3SZO as9gAHJ33mRNXb3C6JaDN7m0zU5CXamlqyvnyuc+zHNb02r01g3FJ/01qR/Meghp AnUxSG1CjJf54hViq8dCRAdqIPWIa1MPrglkt/DPP3Wi2OnOjfZDw2sNwx1CWrT9 VUApEi3X6oLL+ZVLa+DtcqT5a6/uIoD5vV1rfG6Tu3r5oDbV7QToAeQB3Mal1UvJ Xnmoly6UqMPvOg+pW2kDw1MB1AhJ04NFWePdhXGE4E7R0vd4CdjYu7iPnWdZ4oFF JysQRq8SQYBvzjHMw7yqw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrudeifedgieeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhepofggfffhvffkjghfufgtgfesthejredtredttden ucfhrhhomhepfdfnrghrrhihucfirghrfhhivghlugdfuceolhgrrhhrhiesghgrrhhfih gvlhguthgvtghhrdgtohhmqeenucggtffrrghtthgvrhhnpedugedvlefgueegheefjeet ffduveeltefhfeegjeffffelgedttdevkeegkedugfenucevlhhushhtvghrufhiiigvpe dtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehlrghrrhihsehgrghrfhhivghlughtvggt hhdrtghomhdpnhgspghrtghpthhtohepuddpmhhouggvpehsmhhtphhouhhtpdhrtghpth htohepihhnthgvrhhnrghlsheslhhishhtshdrphhhphdrnhgvth X-ME-Proxy: Feedback-ID: i8414410d:Fastmail Received: by mailuser.phl.internal (Postfix, from userid 501) id 5C41629C006F; Sat, 7 Sep 2024 09:21:29 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 Date: Sat, 07 Sep 2024 08:21:05 -0500 To: "php internals" Message-ID: <8f7a2dcc-4af7-4a03-b256-55e8ea49e9e0@app.fastmail.com> In-Reply-To: <71DEAAB9-D788-4EB9-A07F-E47211F92F78@newclarity.net> References: <0fa39535-f22d-4eba-b4df-90abe39e683a@app.fastmail.com> <79e58673-50ec-461e-a998-736b020e4287@app.fastmail.com> <928A2984-6035-4DA6-9EA7-12E85237C270@php.net> <71DEAAB9-D788-4EB9-A07F-E47211F92F78@newclarity.net> Subject: Re: [PHP-DEV] bikeshed: Typed Aliases Content-Type: text/plain Content-Transfer-Encoding: 7bit From: larry@garfieldtech.com ("Larry Garfield") On Sat, Sep 7, 2024, at 7:42 AM, Mike Schinkel wrote: >> On Sep 6, 2024, at 4:45 PM, Larry Garfield wrote: >> Aliases can then be used only in parameter, return, property, and instanceof types. Extends and implements are out of scope entirely. > > Is there a strong technical reason why extends and implements should be > out of scope? > > There is definite utility for this, to create a local alias in a > namespace that can be used throughout the namespace rather than having > to refer to the external namespace in many different places. Because it quickly can produce nonsensical syntax. class A {} class B {} typealias AB: A|B; // This is logically nonsensical. class C extends AB {} While there are edge cases where that might be logical (if A and B are interfaces and &-ed together, then it's kinda sorta the same as C implements A, B), separating those out and allowing just that subset sounds like a lot of work for dubious gain, and introducing surprise inconsistency. Better to just avoid that entirely. --Larry Garfield