Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:121521 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 93041 invoked from network); 30 Oct 2023 12:46:50 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 30 Oct 2023 12:46:50 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id CD61E180511 for ; Mon, 30 Oct 2023 05:46:49 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-vk1-f172.google.com (mail-vk1-f172.google.com [209.85.221.172]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Mon, 30 Oct 2023 05:46:49 -0700 (PDT) Received: by mail-vk1-f172.google.com with SMTP id 71dfb90a1353d-49d0f24a815so1794087e0c.2 for ; Mon, 30 Oct 2023 05:46:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1698670008; x=1699274808; darn=lists.php.net; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=9I0v4CDBP0V53ZCPjwT8ZSa8IvvrU3TO5vED3Zlkf4g=; b=Fe2SGRid2afUTsFsskrKwDLAMRaSVqDx6Gfe/4jgB6XcqdUJL57/LL52dkhsFzLcPF nSRVibU+hIN/WbXbEIizL9c/OgWL03Lafou7LOqL/iX4d0caOdwT9zP8YeniAup0VwZk YLNHlr2nR+Ticx3EvbIEVRk0X0jGfeTsyXd+vQ+xmptiJ9ZBoi+ISYd6twkqhgEJLK/r HgAe9B/48Fkf1PmWb4pmuuypkgUgRcYb5pEyojXY7DpmRBCj24DHJaBRkSBDw3ycovVX AiLnp82cgl+bBjQJ7eAgE2MpUrExx6R9EPT1aeSO1wJ/E4MP5ZVOqg89kMv7v88EcDvW YekQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698670008; x=1699274808; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=9I0v4CDBP0V53ZCPjwT8ZSa8IvvrU3TO5vED3Zlkf4g=; b=D+Mfx+G4OqqXNBz5twhvy4DYZBzmSs/8DiClDRGJKPZmhHAMxWAOMbqG/oKYN6OwJx +7dCU+rL3zaaafBEKTHxhvV0qVCqaEGcNuszsFUjSoo1Pr9hReXewEX7aCsbq318gfLJ sUGolK8fGKmmCjW6o19ev96mImiqk2cwNvZEV3pNJjaqT6miv5GJwX0+GdnYYKKAONR+ WMDmzChr5tSdkF51/cX3tv11T1JsA+ztgJ8PdUv7iJP3m1fqZGAduP+wpqgLBZVG4IHB tMPdZVTVqOe5fD5A0SOk/CwrKF7itWfbmbty869qoQaB0Lq3EVowNPt4GVffzun4XziQ +mNA== X-Gm-Message-State: AOJu0Yy9cRH1booLsG4/qn3iE3Oz1H0o6Id+YERbL9GPwMHtRiWimrng Rw2G97EHAY/OeQJNYB3EZHEH0K93FHRMf53/hOo= X-Google-Smtp-Source: AGHT+IFPgqaIMcPPYWV4XmbNj+NYHdwWhHQbvcIVbnOoEQeqSaOkWATO8G3i3HiM4IgCW5dDsn0nPztJ88dg6dYTlTo= X-Received: by 2002:a1f:724c:0:b0:49d:d3dd:fa40 with SMTP id n73-20020a1f724c000000b0049dd3ddfa40mr6048752vkc.5.1698670008365; Mon, 30 Oct 2023 05:46:48 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Mon, 30 Oct 2023 09:46:11 -0300 Message-ID: To: "G. P. B." Cc: Robert Landers , =?UTF-8?Q?Alexandru_P=C4=83tr=C4=83nescu?= , Oladoyinbo Vincent , Mike Schinkel , Larry Garfield , php internals Content-Type: multipart/alternative; boundary="000000000000707da00608ee6ea9" Subject: Re: [PHP-DEV] Re: Basic Type Alias From: ericklima.comp@gmail.com (Erick de Azevedo Lima) --000000000000707da00608ee6ea9 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable File-based are the worst. Let the types be attached to namespaces. As we have autoloaders, everyone is free to load them however they want (PSR-4, file, custom autoloader, whatever). Best regards, Erick Em seg., 30 de out. de 2023 =C3=A0s 08:34, G. P. B. escreveu: > On Sun, 29 Oct 2023 at 20:36, Robert Landers > wrote: > > > My personal opinion is that file-based type aliases would be the best. > > It solves an immediate problem while introducing a problem most people > > will never have (needing to reuse the type aliases elsewhere). It > > allows them to be used in functions and classes, while also making > > code more readable but not opaque outside the file. For example, if > > there is a type called BigNumber that was an alias of > > GMP|int|float|string, outside the file, knowing the actual types in my > > IDE is more useful than "BigNumber" and doesn't require me to dig into > > the definition or even agree with the other file's definition of > > "BigNumber." I just need to know that I need to pass it one of those > > types from my own code. However, reading that file's code, I don't > > need to know the intimate details of the aliases to make it more > > readable. > > > > If we find ourselves constantly writing the same type aliases in a > > bunch of files, we only need to wait less than a year to implement > > "global" (as in, available once include'ed) in the very next version > > of PHP. > > > > No, this is actually ridiculous. File based type alias are dumb and I wil= l > vote against this. > My main motivation to work on function autoloading in the first place was > to create a mechanism so that adding a new type autoloader is very easy. > As I already find the semantics of one interface per file dumb, let's not > make it even more ridiculous of having a single line in a file, especiall= y > as a library/project will likely want to declare more than one type. > > An IDE should very much have no struggle to resolve what the type alias > actually resolves too, they already do this with classes and interfaces. > And needing to declare every alias in every single file of a project is a > ludicrous idea. > > Best, > > Gina/George P. Banyard > --000000000000707da00608ee6ea9--