Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:121519 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 87856 invoked from network); 30 Oct 2023 11:34:10 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 30 Oct 2023 11:34:10 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 46A2F180212 for ; Mon, 30 Oct 2023 04:34:10 -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_H3,RCVD_IN_MSPIKE_WL,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-pj1-f54.google.com (mail-pj1-f54.google.com [209.85.216.54]) (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 04:34:09 -0700 (PDT) Received: by mail-pj1-f54.google.com with SMTP id 98e67ed59e1d1-2800ab6fa66so2034259a91.3 for ; Mon, 30 Oct 2023 04:34:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1698665649; x=1699270449; 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=lJRbNqdJZSQ/yzqkc04GttmhnZdYCxb+q9HddmdZwLk=; b=BUVqpdjglGfj3+tNvYgSG6TOu8tI9BJEe0USZmhd8A39yb2o9aSpMpHkEVuN2t0EJu psHgcLExlyYzMNT36tGzjWR+3gguHmAE6TzasQ3qjYhNkYTFO0bGchc8Eq0dE1FmdUUf TxI0LuEfLy6IQP5dsbLwDylFDkIiD6XnldHkin+gnwjIIyYquA2MizVUNCVCIXecXhct mHFNDrBpxeJ51GkYikEQMshQA3CTCuj/XGefqk7Yconnak5j7FKz+mbUxDOeJTF/Urwy b5eWgg/OrjjSc44WZHSbB8Jx62llIwqeqZNq8V62EsixE4q4jNuEPakcGLq2GiTWGiOg 4b5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698665649; x=1699270449; 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=lJRbNqdJZSQ/yzqkc04GttmhnZdYCxb+q9HddmdZwLk=; b=YRvmZmZEAo5Xd2rKoI6rtEGIZ4IP4GYSFciIGk0VzaRWnFsMx4/QYweUTGyGa516TZ aNdUtbyFuOZwHb4zmLhMmcWb7LMTsuGtsy5yYW0p2sESgxc+YYaB6vHQ2YxhdezdBJl0 j/sHF5meP0ejjk5n7pTw/tICF9kHnGZPWdK0+quXaPsUS8VAPQfU1ZMi+oDa9mrVcHpQ eRlmfCG868RKZRld8oor5pMTMWwRn/nu9ZhJyTuLhJKkvETjXZgsgaHENgkZdQI+edEb adCuRBrPi+8rZc3Ui45oAsAPj2wam5dTZ16XbzgchX9ONbtwKpNHUopw7sVggzfgENRc 1aGQ== X-Gm-Message-State: AOJu0YzlXP79j0jBIhLVnabOEX4uYGNY3TULMF65ba5JTBnTLhPCd5wR gjK07/u1F3YwKUAH3Snbe2OqEk6eFFRp6NJzzz8= X-Google-Smtp-Source: AGHT+IHn/YEHUYhEi7CeXSUlxhyHk119czaVzOxYCdTWGwfMsnYLm/RH9879uNAGAVvRza0Ts+dd7kMysVlPHklQVqY= X-Received: by 2002:a17:90a:5e:b0:27d:7ebe:2ee with SMTP id 30-20020a17090a005e00b0027d7ebe02eemr6091177pjb.39.1698665648659; Mon, 30 Oct 2023 04:34:08 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Mon, 30 Oct 2023 11:33:57 +0000 Message-ID: To: Robert Landers Cc: =?UTF-8?Q?Alexandru_P=C4=83tr=C4=83nescu?= , Oladoyinbo Vincent , Mike Schinkel , Larry Garfield , php internals Content-Type: multipart/alternative; boundary="00000000000094a2800608ed6a99" Subject: Re: [PHP-DEV] Re: Basic Type Alias From: george.banyard@gmail.com ("G. P. B.") --00000000000094a2800608ed6a99 Content-Type: text/plain; charset="UTF-8" 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 will 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, especially 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 --00000000000094a2800608ed6a99--