Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:129532 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 1F6831A00BC for ; Wed, 3 Dec 2025 21:28:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1764797303; bh=wmhXMyyTxtp0zM7QnNxhTGjR3GbokqBlX5Fiokb6mcQ=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From; b=iZm2NEJc5+j/suCfYlzyb/m6CXNnPUzduAmGNgOCaV6vvtUgDeOj/xi4VF8j1oMt6 6HnEURMJZmDTCoCHPyJXnD/lOs5PED3cuZMdiJmUFS6M17m5tVAB3XsH4LJrVC/fvw lQd4StIARTT2RKeFp28A/dJ62u3KChOKaFlvsyMYyBguP+c+T8kwVsIz65oCeEWrk7 jxqXQCGRed8NQtmWpmVnXGNRmx5Nj4zA5WJsEiI1il9vQ+GkGu9m8aODpUr5utgKK8 9rhsVyW/QZVsT1bjFJFqxPeVS+eQ8VuhPxEFw/F3BnWIDYyIPEbbcMVHzsDjFV61Tz gakUn41IVbbKQ== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id EBCE31801EC for ; Wed, 3 Dec 2025 21:28:22 +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=0.6 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_MISSING,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: No X-Envelope-From: Received: from premium76-5.web-hosting.com (premium76-5.web-hosting.com [162.213.255.108]) (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, 3 Dec 2025 21:28:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=pmjones.io; s=default; h=To:References:Message-Id:Content-Transfer-Encoding:Cc:Date: In-Reply-To:From:Subject:Mime-Version:Content-Type:Sender:Reply-To:Content-ID :Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To: Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe :List-Post:List-Owner:List-Archive; bh=EUbaJgwiKjqNQGmoLA7hBBcpqC9wtk+pBpBL/OLTcCM=; b=6U0Tw+yyt2X5Y87JeVogz4qBSI fCkgB7XnCIJ7OeBOGgRkuoLP433AA8eKpPWHx+piDlaURbUM3B4he6n7SxKC/I1hYplSFdf1rKKz/ 3cTLb4PFU1xPaj4WT1ODH0Zt329i+TLqWBxSrb2J393UlpVajyn1Wj2hyHuAb41LeT/GJiP2u5Kwk Ys+PKFPdo56V9TeeJFXHGTRkWTG8g+zDYxKYfT2QHiQjYgzGReS7eqqLf4potAkf9XidES0FTQCIP ErxY1lDgNBA/I4syuK12Kedb/umQt7x2mlQzVy7+EDY5jtjFbPmeFml9vcTGQY2zA/XODx7GX3VDI yphTCbhA==; Received: from 107-223-28-39.lightspeed.nsvltn.sbcglobal.net ([107.223.28.39]:51059 helo=smtpclient.apple) by premium76.web-hosting.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1vQuOM-0000000G6s9-2Fat; Wed, 03 Dec 2025 16:28:06 -0500 Content-Type: text/plain; charset=us-ascii Precedence: list list-help: list-unsubscribe: list-post: List-Id: x-ms-reactions: disallow Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.700.81\)) Subject: Re: [PHP-DEV] [RFC] Type Aliases In-Reply-To: <87e9d1bf-e407-45c1-9fad-d8759405ab8b@app.fastmail.com> Date: Wed, 3 Dec 2025 15:27:55 -0600 Cc: internals@lists.php.net Content-Transfer-Encoding: quoted-printable Message-ID: References: <87e9d1bf-e407-45c1-9fad-d8759405ab8b@app.fastmail.com> To: Rob Landers X-Mailer: Apple Mail (2.3826.700.81) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - premium76.web-hosting.com X-AntiAbuse: Original Domain - lists.php.net X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - pmjones.io X-Get-Message-Sender-Via: premium76.web-hosting.com: authenticated_id: pmjones@pmjones.io X-Authenticated-Sender: premium76.web-hosting.com: pmjones@pmjones.io X-Source: X-Source-Args: X-Source-Dir: X-From-Rewrite: unmodified, already matched X-Rspamd-Queue-Id: 1vQuOM-0000000G6s9-2Fat From: pmjones@pmjones.io ("Paul M. Jones") Hey Rob & all, One objection, one question. The objection is to `include types 'types.php'`. You've clarified why = types cannot be autoloaded (thanks again!) and so this is a way to let = the compiler know where the types are. But I have to say I've spent a = huge part of my career removing include/require when refactoring legacy = code, and introducing it here causes me great heartache. The question is a little more complicated, and also involves = autoloading. Given a class Number that can be autoloaded ... namespace Foo; class Number { /* ... */ } ... and *another* class in the same namespace, that creates a "number" = type alias... namespace Foo; use type int|float as Number; class Bar { public function add(Number $a, Number $b) : Number { = /* ... */ } ... which one "wins" -- the runtime autoloaded class, or the = compile-time type alias? (Apologies if this is covered in the RFC and I missed it.) -- pmj