Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:125470 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 B53751A00BD for ; Sat, 7 Sep 2024 14:49:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1725720710; bh=7nFiTZmtdLPEYfKb3k81TeUolJ6ENnzvKynw2ebKCyI=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From; b=PJr83QvcsOa9/NS0U/mXlKZbcRfL3jz40hTiG0aHJHGcVMxAkHEVmDtubzQzz/Ppj twgkIj/LKfmWh5ynIxTvrpW1Dwf5covqpWGJFgxdiKwsC9QXtm0BvUQalGGc7YV2Y/ tfGsWYGvh+yldw5B7LKMdlT9qiWav+qVSqYQIuawYpWz4tkmL3/A27JTJQR1r+Kr3Z iJaqSUQIGtz/fNP/Ijfmn5RjWOYjtb14DsOizWQo6j0xzC2hAwaHY9B3QXwno9oqtB 6MyfwTmYHJ6IIOxjb5hISrHMSc5TC+hzfgWR//hFBkrJiQy0REQ1xGaQXxj80geNny jxbIbx8v5liwg== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 381F618006D for ; Sat, 7 Sep 2024 14:51:50 +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.8 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DMARC_MISSING,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,SPF_NONE autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from mail-yb1-f181.google.com (mail-yb1-f181.google.com [209.85.219.181]) (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 14:51:49 +0000 (UTC) Received: by mail-yb1-f181.google.com with SMTP id 3f1490d57ef6-e0875f1e9edso2974607276.1 for ; Sat, 07 Sep 2024 07:49:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=newclarity-net.20230601.gappssmtp.com; s=20230601; t=1725720589; x=1726325389; darn=lists.php.net; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=KX2cZiRFAZUISp8PdDG7dIVXF1MNQ17bgby0mNR0INo=; b=c3Uv7koBlukfgWR2bO7JZ0WVhrXzrVHbGN+kBqFI7T+9DVMobLjhNNzekLcNOTutVI hxFhLSlJgXLIgXNZchf6K0zpPS+1CnAZhhbTZbGmGhSUc+g6NZCJqzR2lXoqDBi6/nSh GahKJLjpJdKAQFkG/DWc+C6ZiDNhGYgIsrFMVz0A2y0lQi6x+QWGRmKEW2qwjS6qylBA E5PufgqW3P7jSMxcJxpgV7cYTjm+zd9lWp4CRE0etvtJRAzwNl1JGqfbyM86idODv3Ih xXAXHnTnet7ghqm98ADOVHW4ptimGxp1PysBFh/b6Rfe6VQQfNiCMiSZHs7MlWYkHz/D EEYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725720589; x=1726325389; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=KX2cZiRFAZUISp8PdDG7dIVXF1MNQ17bgby0mNR0INo=; b=ovGkpAr4Ve7RRpElX032S/dy2IObyaupUth2Vrg5KXuK0d1FjOj8kEwIMWyVt4uBdm Cyd+4tPQlYeFUm3A2G2BCA6o+4HUqsBOctYhT8lfLLJrHZLEgdaB3BcTh/gy4kSqXla1 ZFpUISgHZPNgb1RJ45D3J/0FaY8g77NaRtXjvuIQGhb7LMY5x5VKw3TRMjNM7r2gBwp5 UAFipNqEczmMJFI6pFSbfaxXimAvEdTJyPySHxU1HzS+0leGRcRyt9BavLAmVhWhZ8C2 lR6o732UrdErdgbvEjB6HVPEzs+JbUiN20pwGxswNFI57z5LuvQ7wpyTmfjPl3qYKJtH 70Ew== X-Forwarded-Encrypted: i=1; AJvYcCXXp5Ni1HEVikzWbEkA/xXYVbjIalcRabpIJcqp8pp0dsbyuzCLhzJ5ZDZidGgz5TCEhk3lOGyw3ns=@lists.php.net X-Gm-Message-State: AOJu0YzzXTBIV41XI8H9xha3bZWdslP9WbYNnS7J5iGA3vf2UiUYf4Eb xyNWOJVWNbm6vhjJq9yLzYYX3GnraIY+lxCx+laRGvn6iZ8IqtunLajrTEQDxjI= X-Google-Smtp-Source: AGHT+IGGyGciGqpxbSBsRjInhZXlxbB6dND9T1c2ec7w0t9y8KBqtl855UdEnBuPxId2d75S81Jqfw== X-Received: by 2002:a05:6902:1886:b0:e1a:acc9:d219 with SMTP id 3f1490d57ef6-e1d34a26180mr6946571276.50.1725720589333; Sat, 07 Sep 2024 07:49:49 -0700 (PDT) Received: from smtpclient.apple (c-98-252-216-111.hsd1.ga.comcast.net. [98.252.216.111]) by smtp.gmail.com with ESMTPSA id 3f1490d57ef6-e1d4b2cf2a0sm249179276.8.2024.09.07.07.49.47 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 07 Sep 2024 07:49:47 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.10\)) Subject: Re: [PHP-DEV] bikeshed: Typed Aliases In-Reply-To: <2bb2b656-aace-462d-b8e3-69d23593c6fd@app.fastmail.com> Date: Sat, 7 Sep 2024 10:49:47 -0400 Cc: Davey Shafik , PHP internals Content-Transfer-Encoding: quoted-printable Message-ID: 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> <2bb2b656-aace-462d-b8e3-69d23593c6fd@app.fastmail.com> To: Rob Landers , Larry Garfield X-Mailer: Apple Mail (2.3696.120.41.1.10) From: mike@newclarity.net (Mike Schinkel) > On Sep 7, 2024, at 9:28 AM, Rob Landers wrote: > Keep in mind there is already single-class aliasing with well-known = behavior for both local and project-wide aliases. Local aliases are done = through 'use' statements, and project-wide aliases can be created by = using the `class_alias()` function. Good point.=20 While I'd prefer to be able to use a typedef/typealias syntax, I = certainly would not bikeshed over it. > On Sep 7, 2024, at 9:21 AM, Larry Garfield = wrote: >> There is definite utility for this, to create a local alias in a=20 >> namespace that can be used throughout the namespace rather than = having=20 >> to refer to the external namespace in many different places. >=20 > Because it quickly can produce nonsensical syntax. >=20 > class A {} > class B {} >=20 > typealias AB: A|B; >=20 > // This is logically nonsensical. > class C extends AB {} Gotcha. That issue had not occurred to me as my use of type aliases is = in other languages that do not have union types. So I was more concerned = with this: namespace A\Really\Long\Namespace { class A {} } namespace My\Current\Namespace { typedef A: \A\Really\Long\Namespace\A {} class B extends A {} } However, as Rob pointed out there are already ways to accomplish this = that I was not thinking of, so my concern for extends and implements is = effectively moot. > On Sep 7, 2024, at 9:28 AM, Larry Garfield = wrote: > Methods on typedefs was the sort of "other stuff classes do" that I = was trying to avoid getting into right now. :-) Mainly because I can = totally see how it's tempting, but also have no idea what it would mean = from a type-theoretic perspective. It would only make sense if we're = talking type DEFs, not type ALIASes. That latter sentence is spot-on. -Mike=