Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:118701 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 22373 invoked from network); 29 Sep 2022 03:08:47 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 29 Sep 2022 03:08:47 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 7B046180381 for ; Wed, 28 Sep 2022 20:08:44 -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, 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-vs1-f53.google.com (mail-vs1-f53.google.com [209.85.217.53]) (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 ; Wed, 28 Sep 2022 20:08:44 -0700 (PDT) Received: by mail-vs1-f53.google.com with SMTP id q26so193485vsr.7 for ; Wed, 28 Sep 2022 20:08:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:from:to:cc:subject:date; bh=VoDjhbQgs9TP8vOx89e73gvGAi2DGL5AfSaI8mP6+sI=; b=RDS6Y6EyHhi8VsSOo0OXKHSndJDYVEFJoOZwFXLilJy6p/3M9hNbVHOHBUJplaeNBU L7n3WmL5cNJk2m064AZKdrb4Yi5fUCLsda/197mgOlj98T+27kndRnTQxXlRLwTGhlFi PxBaK0oq9W8nzP0sRkmOsO+l1tfaq0iGRs+9RE6ljorIfQlQoZAcw4M7n+THFgy2Wlct aFNJVhYkm7WdW57x1jKuAW7PsnLwjmqClyqTGCOxW94GiqORtQE8D3lt5KFyKfubjxos vC4nPYkUwx1JWMabCNMTMUuFCl5Sk2uGUIlCwh/VWhgQ6cJHg64lTZrQ/QlNJ/PrtqzJ 40dQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:x-gm-message-state:from:to:cc :subject:date; bh=VoDjhbQgs9TP8vOx89e73gvGAi2DGL5AfSaI8mP6+sI=; b=YqFV/rPDR6zhu9InDNrL0KjWk5TcB8JxkANrDfrm2RiTwoPeeb9JD+kk0xUTiNFxtT DJcxuF9P7shR+FKevGsX4sJ1Ec/vb+k3Yj6vxhCqV5sa1hBaGMFav+S0mTRA7N/unrQ0 WV1lE9uHVbRrl32PzQk5ydSrZByLub8034FvbG2VGokeK5+stqePZUL/kuAJUNRO2VtF KUPUDJbTcsV/Sg3mulK7cFP88vBV/K1bb7CZNsTsoACQ/qhM420UNcg7SmHAT3hKeO4k ZXHGUJFvvqaW9A9uWzgkqyT/dZzKCG3i3SiWClbXvHP56l8yF0mEQw3YuEM1xzhRy8VT 4g8w== X-Gm-Message-State: ACrzQf0IxHRJFEXGZCbl4o/jPK22CMzImmKhskeeZBLyX4v95taULSsc 3eU0/7xhB0gu8EIBeNFs7dzfiFwcb2M721rw67Y= X-Google-Smtp-Source: AMsMyM739L6WIzNNqSWQd2tU6ErxDSId9dGAKay88qzUZZsMbrrTm4sXiV57MNWhbYYi7igMFq+yfreIWRGYmOizgyg= X-Received: by 2002:a05:6102:3309:b0:39a:e5eb:8508 with SMTP id v9-20020a056102330900b0039ae5eb8508mr354896vsc.65.1664420923244; Wed, 28 Sep 2022 20:08:43 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:ab0:77d5:0:b0:3bb:5df4:fc55 with HTTP; Wed, 28 Sep 2022 20:08:42 -0700 (PDT) In-Reply-To: References: Date: Thu, 29 Sep 2022 08:08:42 +0500 Message-ID: To: =?UTF-8?Q?Olle_H=C3=A4rstedt?= Cc: internals@lists.php.net Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] Re: Alias for `int|float` From: office.hamzaahmad@gmail.com (Hamza Ahmad) Hi Olle, I appreciate your idea of introducing a similar concept of typedef. What if you write an RFC explaining that concept. I can join you however in co-authoring this request. Seriously, I have had issues with writing such type again and again. If you look at mixed type, it is indeed an alias of some union types. Adding such an option to userland would lead to introduction of various type hints. Plus, it will help devs write short hand aliases for their intersection types. Regards Ahmad On 9/27/22, Olle H=C3=A4rstedt wrote: >>Hello, internals! >> >>What do you think about creating shorthand `number` for `int|float`? > > This is also related to allow all types of type-hints in the use-statemen= t, > like > > use int|float as numeric; > > Anyone interested in creating an RFC for this? > > Olle > > PS. Original thread here: https://externals.io/message/112209#112209 > (dunno how to respond to an old thread when I don't have the original > message) > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: https://www.php.net/unsub.php > >