Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:121483 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 30676 invoked from network); 27 Oct 2023 08:50:31 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 27 Oct 2023 08:50:31 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 91C611804BC for ; Fri, 27 Oct 2023 01:50:30 -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=-1.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,MISSING_HEADERS, 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-ot1-f47.google.com (mail-ot1-f47.google.com [209.85.210.47]) (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 ; Fri, 27 Oct 2023 01:50:30 -0700 (PDT) Received: by mail-ot1-f47.google.com with SMTP id 46e09a7af769-6ce2eaf7c2bso1155032a34.0 for ; Fri, 27 Oct 2023 01:50:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1698396629; x=1699001429; darn=lists.php.net; h=cc:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=zDjzryrnsETBmyWG3ovfwJTXSatmwz09jJ/8wvOvR9s=; b=LSsx+FcevKb2/GLhXLDcdxW2/nTuhFe9lWjouIqI7Y0Stfxo/ed3bA/qUh/dhxGPyv mt/VIQtzkmKSu8B+Z2v0XzS3XE41y+eRgbC4F1+7lczqjH5Fa7SVLjFuS7xYwnUPr/wp Hh01FTst2U5IcTRbB72jodwAi7lGd+6MZW0GZfVdjgfh8TaE57Y70DlSX3Sie2H+mu81 cEaTb0mDcjbMeHXTrEBsD2uNC9uABbqN1uNGWELyqOvub4y+khyaRPmmhPafdSDHGmq9 iSyOk6D2sQT/c+KFgaeaVaB6ujrjRBkFPnwc5Io+u7v73iD89Z4/nPzS3fkcPpaBct2t Jqdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698396629; x=1699001429; h=cc: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=zDjzryrnsETBmyWG3ovfwJTXSatmwz09jJ/8wvOvR9s=; b=GRXsU4hKNnHhaJU5vQ4MdfndtHNfDiVoEFxK/3tmJ7w6kDzmgLnx/faPF+5Gjd1R9e JxQj9O0lQZjKicjYHaV7+ebJoGI1H6BX3tXuOZbwGlU3dVeSBJCaAZFUuRiq3hzbx4Ud ZJ+BM6AnIqcgDHeNn4cFe2jZeEylBodj0qzn3iFqyKDyrZmBBDI7Jd0G4mr5HsZ/S9tD ccSYU8ZExQVbHF3vXiwRf/daruIL9918ZAVkD+z93kgZDQZnQhC28bzin0aP9U8AVezP vBGOPZ7MMcbOHyCRjGOGDSYQbkYfRO/FLGvK1ASZQvp2ax3zsvNpb2bCy5efpPi2M2rY ZP/Q== X-Gm-Message-State: AOJu0Yw6y4X5dDGgA81lgeM0sK1TcRR0ZbJwoXY3mIwxRpGyQHNZEq4f +y0nRVrUITT9smggi11v0D1XAjMpJDt6AstCL3RDZgy5t+AEZVcKdzo= X-Google-Smtp-Source: AGHT+IEsrdQ9l+LczG+DR9Oer4i48c2aJQO3uqCQgtoCSGRvViGx4n3niWmcZiD/Itj8Vygq/n4eYaO/N50x8fr+EzE= X-Received: by 2002:a05:6830:14c6:b0:6bd:b0c9:a8d with SMTP id t6-20020a05683014c600b006bdb0c90a8dmr1819496otq.25.1698396629174; Fri, 27 Oct 2023 01:50:29 -0700 (PDT) MIME-Version: 1.0 References: <031056A8-8F22-439F-9B77-75929798D2DD@gmail.com> In-Reply-To: <031056A8-8F22-439F-9B77-75929798D2DD@gmail.com> Date: Fri, 27 Oct 2023 10:50:18 +0200 Message-ID: Cc: php internals Content-Type: text/plain; charset="UTF-8" Subject: Re: [PHP-DEV] Basic Type Alias From: landers.robert@gmail.com (Robert Landers) Why are we reinventing alias syntax? We already have "use" to alias per file: use My\Namespace\MyFancyType as MyNewFancyType; use string|int|bool as MyFancyType; Further, in PHP we specify a type using a colon, not an equal sign, thus this feels more idiomatic to PHP (and less ambiguous): type MyFancyType: string|int|bool; or using existing functionality for creating aliases for types: class_alias('string|int|bool', 'My\Namespace\MyFancyType'); However, type MyFancyType = string|int|bool; immediately makes me think of the consts "string", "int", and "bool" being bitwise-OR'ed together, and not a type. The only hint that we're dealing with types is the `type` keyword. Robert Landers Software Engineer Utrecht NL