Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:109827 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 50902 invoked from network); 24 Apr 2020 15:26:56 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 24 Apr 2020 15:26:56 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 299DF1804C7 for ; Fri, 24 Apr 2020 06:59:05 -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 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-il1-f174.google.com (mail-il1-f174.google.com [209.85.166.174]) (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 ; Fri, 24 Apr 2020 06:59:04 -0700 (PDT) Received: by mail-il1-f174.google.com with SMTP id q10so9346640ile.0 for ; Fri, 24 Apr 2020 06:59:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=+Sjyzd27g/aMJ4yyQAUsxE6rHlvUARRtfN6Ja7+YyNA=; b=IcZxjAs/eWD12MC0OHS4z8zwc9ikaqdFph4v2pWm63dO1hloZyAsgUCmsOjo2/xtZr t46xBE4bmiw0680hWcIDNr5Rv/m9f3Fdztfn70x/Ny54PEwymy2yQedS0xbPnEHvB8LP hWMDvABBkjEpwkHlcS4qDKQr7xVkgC+yi/sowNj5au7S2rDvXyoaV1SFV4YwOMeT8Ooj 7oBeuZHsPhRRFivlaafX8gc5PZVIwjT629SlueqZJO4CuziHty+eJwWDFtP2Ba8yCqeJ esBTC61sJ7G4D6IYnl2eeu0XcfkLFkvZcMCUtmdpS4i0WudNi3oRBKKkr6CeMP69h+90 pSGw== 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=+Sjyzd27g/aMJ4yyQAUsxE6rHlvUARRtfN6Ja7+YyNA=; b=Mhh/AqvtCq0ouS310hzeW4NIDAc752ETCR8yvgkUtIrjn3DZD+z0wocLFs789MAanL bpYpum6PfaTrGYmFfq8krekxX9w2ZBkRiKKrxz2UI+fu0jIBNcRuMgcak1Veud/2V713 25Q9G30uMjUZU3wuS2eVVehxVI1zmHw7zotnFV3YpE3Brir3LIfjVI0kvybZjOQFTDuq Jd1+JRcpKCXb38KZuwtld6er4Qalvioff6zQrGiDxULeICTc2jXCBDdwxEBHcoMDg0TB EekdGuqv4KCC6ZHXC2Wu0Y7nBAg25gMN7UDVyRBXszQy3oIcRhFNLGizG+NxjUKOdvSc 1CXA== X-Gm-Message-State: AGi0Pubd1R8SChNaRm5D6Y4oEV4OjNEjdEXCrJi0N/rEOMr0ptJo0y7i Nn/Uj9lY62J+ERpDvuLNW8MtxydrhGQmP+3wZMc= X-Google-Smtp-Source: APiQypKKyKlepNkTfQqBtyDDsd4Tz0mdlxM8dr+mrd6wD524IbeT7pLqRQFHX3MA1qRTSLuZ79K9g5EedmtFPScLsVs= X-Received: by 2002:a92:2450:: with SMTP id k77mr8390538ilk.282.1587736742475; Fri, 24 Apr 2020 06:59:02 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Fri, 24 Apr 2020 15:58:50 +0200 Message-ID: To: Dan Ackroyd Cc: PHP internals Content-Type: multipart/alternative; boundary="000000000000883de405a409c403" Subject: Re: [PHP-DEV] [RFC] Mixed type From: ocramius@gmail.com (Marco Pivetta) --000000000000883de405a409c403 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hey Dan, On Mon, Apr 20, 2020, 13:18 Dan Ackroyd wrote: > Hi Internals, > > Here is an RFC for adding a 'mixed' type to the language: > https://wiki.php.net/rfc/mixed_type_v2 > The RFC builds on an earlier draft by Michael Moravec. > > Part of the motivation for pursuing this RFC was my recent experience > in upgrading an application to PHP 7.4. > > Being able to add types to the application made the code much easier > to reason about, but there were places where I couldn't add type info > due to the lack of mixed. That made it hard to see if that piece of > code had been upgraded (but type info couldn't be added), or if that > code still needed to be upgraded. > How much would you like/be adverse to a rector rule that changes `mixed` into a long union type (without `resource` in it)? Considering above posts, `mixed` is effectively `null|bool|string|int|float|array|object`, and that the language has the ability to use this type in 8.0, I think making `mixed` very painful to write may be a big advantage. `resource` is still a massive PITA: not sure if it can be removed within the decade. Heck, we may even deprecate signature-less parameters and return types in a very far future =F0=9F=92=AA > --000000000000883de405a409c403--