Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:109833 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 90388 invoked from network); 24 Apr 2020 17:12:46 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 24 Apr 2020 17:12:46 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 1FA3F180508 for ; Fri, 24 Apr 2020 08:44:55 -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-f176.google.com (mail-il1-f176.google.com [209.85.166.176]) (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 08:44:54 -0700 (PDT) Received: by mail-il1-f176.google.com with SMTP id w6so9703422ilg.1 for ; Fri, 24 Apr 2020 08:44:54 -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=AhyRHROWp1GqpW6A6qF/5/fIZXIT4TkHiyGKUOtrz7s=; b=F+2nMn8/tl2XRklOp6HEV7ddn5cRxHpQKYT4rXXDyqCOAzW92UHj1g86mXVnApvDq1 JoKGAKgLqFxtL4wVUwix9AWYiDHzl9DpzL+N65/8CDpNBZcKubnAwmO/gehDtSzSHTMa uI14fB+4MSwGx5BroGb1VWyFg4ysNeogpCYjBg9fLfgdeuF254o+ssMb20pAH6zLtgKG IPRjIgIQ4rNHdc5hsHZbldKkQ3UBbCFLy1Fjeacl5aCrLctREhUNn3Apd0hk0RxcPYCp a/N2g1Q4TGrCq7OBNMNVmdmZbreUDY1tG9Z7WwaFB/JREggJ0q2ZlHea9pJqY3r8Ht3S p9tQ== 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=AhyRHROWp1GqpW6A6qF/5/fIZXIT4TkHiyGKUOtrz7s=; b=qwRbW9d9lpUc160OxkDnoYOejLc1gh30JCBoN76gdEzsi4tqxAmFhCb4zqiWQb9qfQ YUT0bPP9GiWhdlz5nDarozMZqRyjfLmKB439OQ6sXIbmCt1Agt8iRZ+Bfx/Vtn0kxjU2 KIvaGUoUKPHyqHBXGEcRyzsJ+5xQdb1dM1YypQgH3Tb21rMSHnWhaaoGXT0VOUgmJiLs exmq3ERSxXzCmRhxdWJagpP6na/gzhTAIWIHOHbbgeVPuUSNsUuvhoCT4eQs5jFUGR+1 ORNB+u4h4AyqrB6x8eSh5yiLrVF1C2J28Hs5MZTN90ET1EHipwvZd/EwNd9wB+getOVz EZgQ== X-Gm-Message-State: AGi0PuYZxrVLs1DERXyFWDDX/HyXtxTzmvtlYc+clc615TbsKU2T7Zf4 TR7bIKYBtaw5lR9DPWDfVWnitHbj35V9ovCsjcY= X-Google-Smtp-Source: APiQypIv9D+fNC2NK3XA+6P6/o6lgcLk84/Hc8omSeQfx2cQoyc4Xb6typX9cSJqjwSqFbLb03seDUygE120z0GkRZk= X-Received: by 2002:a92:cc4a:: with SMTP id t10mr9241018ilq.292.1587743092348; Fri, 24 Apr 2020 08:44:52 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Fri, 24 Apr 2020 17:44:40 +0200 Message-ID: To: moliata Cc: Matthew Brown , Dan Ackroyd , PHP internals Content-Type: multipart/alternative; boundary="000000000000039f4b05a40b3fef" Subject: Re: [PHP-DEV] [RFC] Mixed type From: ocramius@gmail.com (Marco Pivetta) --000000000000039f4b05a40b3fef Content-Type: text/plain; charset="UTF-8" Hey moliata, On Fri, Apr 24, 2020 at 5:27 PM moliata 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 (please > 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 we > can pass callables to properties that are declared as `mixed`, right? > The only limitation right now is `resource`: `callable` is always either an `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/ --000000000000039f4b05a40b3fef--