Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:109834 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 93520 invoked from network); 24 Apr 2020 17:30:21 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 24 Apr 2020 17:30:21 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 4B0A7180508 for ; Fri, 24 Apr 2020 09:02:32 -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.3 required=5.0 tests=BAYES_00,BODY_8BITS, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H2,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-40130.protonmail.ch (mail-40130.protonmail.ch [185.70.40.130]) (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 09:02:31 -0700 (PDT) Date: Fri, 24 Apr 2020 16:02:18 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail; t=1587744149; bh=3gYzJqv7TzESSrNPXQe/FQWLM9vjVRVUUHjH8TXX9SE=; h=Date:To:From:Cc:Reply-To:Subject:In-Reply-To:References:From; b=qz0Jy6md/Uq6OBc251Dz3oSSD7jaTHsdc6wzmWC60AyTYE93F9pSgjO8cBgcTR2TA raIMPF+zfp/vGcq5Dj5nmy0SlEGaK2+y7bWkEHTMKQkUiqSMzxRbaw/+vphy/i9fOb 5HVya5pdqSuJPQHv0wURmpqdutkqH3M114wWNzTo= To: Marco Pivetta Cc: Matthew Brown , 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) Hello, I did some tests and in fact it seems you're right. Thank you for letting m= e know, didn't know! 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:44 PM, Marco Pivetta wrote= : > Hey moliata, > > On Fri, Apr 24, 2020 at 5:27 PM moliata moliata@protonmail.com wrote: > > > Actually, it's not quite possible to declare a `mixed` type using union > > types given that it's not possible to make properties as callable (plea= se > > take a look at my "Typed callable properties" post in the mailing list)= . As > > such, if we wanted to make a property hold a callable, we would have to > > fallback to just not using a type hint at all. > > Correct me if I'm wrong but this behavior is addressed in the RFC and w= e > > can pass callables to properties that are declared as `mixed`, right? > > The only limitation right now is`resource`: `callable` is always either a= n > `array`, a `string` or an `object` that implements `__invoke`, so > `callable` is a subtype of the union type mentioned few posts above. > > Marco Pivetta > > http://twitter.com/Ocramius > > http://ocramius.github.com/