Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:109719 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 16449 invoked from network); 20 Apr 2020 15:44:24 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 20 Apr 2020 15:44:24 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id D79C318050B for ; Mon, 20 Apr 2020 07:15:36 -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.4 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_SOFTFAIL 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-qt1-f182.google.com (mail-qt1-f182.google.com [209.85.160.182]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Mon, 20 Apr 2020 07:15:35 -0700 (PDT) Received: by mail-qt1-f182.google.com with SMTP id l60so8487804qtd.8 for ; Mon, 20 Apr 2020 07:15:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Q13SRpJ0amsf6CWPX8LDg6jawy6/FssAfUceXTd9RJI=; b=uoJ6CD52BVQA8P5D6fAFOz51XA0VHqFdGR2i+RM/iKE8fr7HuZJyc0NndLhZ4qy3G6 5hlyVkzLBIoCTowBRrcG41vvfSeU/Fa22ki6XcCqIGeB0ojMwnwN1FhtFDa3Jktqofwg dwM4HdDoiY+5EXM/v14uyTm8WuWbUDGdj3SxQ280KiL0HCTBKb1gzLP9Qz0iuXD5RD39 2Uc1VZQai6wjEOfwqt0Bso7YaIOU1mFsFEdVePxfzPbFsuTPWqi2AJ8mVabjNAUsrxih WRvusnHqoBzNiTVfu9qshfzvYnYNYMLpiO4tvCin3bP2xcoUr/qYQVIBFm1bWZgW64h5 0VRA== X-Gm-Message-State: AGi0PubIIeszaFNTMnoUClfQvi8MLPs+H3vWD7Otn8LqZ8SMkrqJyVEr liJMk026rvZLh9Kv64hzCXW89GQZyMOOEUZvFEMP6Mt4f6NC7w== X-Google-Smtp-Source: APiQypLeAHoworInaJSz4v7LNi6l9hJurDJK+PofPNr4hULrClV9Idy0eQYdYD+jgGov88buSmKtqRYLpimtID036+8= X-Received: by 2002:aed:250c:: with SMTP id v12mr15571615qtc.351.1587392134859; Mon, 20 Apr 2020 07:15:34 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Mon, 20 Apr 2020 09:15:24 -0500 Message-ID: To: Larry Garfield Cc: php internals Content-Type: multipart/alternative; boundary="00000000000051634905a3b9885a" Subject: Re: [PHP-DEV] [RFC] Mixed type From: pollita@php.net (Sara Golemon) --00000000000051634905a3b9885a Content-Type: text/plain; charset="UTF-8" On Mon, Apr 20, 2020 at 8:52 AM Larry Garfield wrote: > On Mon, Apr 20, 2020, at 6:17 AM, Dan Ackroyd wrote: > > Here is an RFC for adding a 'mixed' type to the language: > > https://wiki.php.net/rfc/mixed_type_v2 > > > > I am not against this, but now that we have Union types what places are > there where the currently available type declarations are insufficient? > Resource seems like the only remaining gap where you'd be forced to use > `mixed` instead of a union. > > I imagine some type combinations get pretty wide. Like, this is verbose AF. null|bool|int|float|string|array|object|resource For the long term good of the language I'd prefer type aliases (or typedefs or usings or whatever you want to call them. use mixed = null|bool|int|float|string|array|object|resource; use scalar = null|bool|int|float|string; use number = int|float; That said, baking 'mixed' in as an implicit alias of the above isn't problematic for that future. -Sara --00000000000051634905a3b9885a--