Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:109832 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 86554 invoked from network); 24 Apr 2020 16:55:38 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 24 Apr 2020 16:55:38 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 5F9A41804F2 for ; Fri, 24 Apr 2020 08:27:50 -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=-0.6 required=5.0 tests=BAYES_00,BODY_8BITS, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, SPF_HELO_PASS,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS62371 185.70.40.0/24 X-Spam-Virus: No X-Envelope-From: Received: from mail-40140.protonmail.ch (mail-40140.protonmail.ch [185.70.40.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Fri, 24 Apr 2020 08:27:49 -0700 (PDT) Date: Fri, 24 Apr 2020 15:27:41 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail; t=1587742067; bh=U+MTpbAMAKpqnqIEom8RRGO/U8XL2umyjuvO/BvJEss=; h=Date:To:From:Cc:Reply-To:Subject:In-Reply-To:References:From; b=GvFWtMqnikKFWeus4SDeWrlyAJgmcMUJGd3ER1eTaYVSRyV3aopZ8dH4p6HBohudk xy3A8Z61E4qndrm2BuRPIbB9lFN3yAuHFT+9H4B2kEX5igIOqUeG7P5gNDFvL/cZ1i WSnfSrIi8Ev92wtVL2f5bLLIW5o6Jpf3kOCwbuoY= To: Matthew Brown Cc: Marco Pivetta , Dan Ackroyd , PHP internals Reply-To: moliata Message-ID: In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] [RFC] Mixed type From: moliata@protonmail.com (moliata) Actually, it's not quite possible to declare a `mixed` type using union typ= es given that it's not possible to make properties as callable (please take= a look at my "Typed callable properties" post in the mailing list). As suc= h, if we wanted to make a property hold a callable, we would have to fallba= ck to just not using a type hint at all. Correct me if I'm wrong but this behavior is addressed in the RFC and we ca= n pass callables to properties that are declared as `mixed`, right? Best regards, Benas Seliuginas =E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90 Original Me= ssage =E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90 On Friday, April 24, 2020 6:09 PM, Matthew Brown = wrote: > > 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|resource`, > > At runtime those things are effectively the same, but in the world of typ= es > mixed has its own distinct meaning =E2=80=93 I'd be very averse to any so= rt of > corresponding replacement.