Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:112246 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 60886 invoked from network); 14 Nov 2020 11:54:43 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 14 Nov 2020 11:54:43 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 17EE81804C6 for ; Sat, 14 Nov 2020 03:17:53 -0800 (PST) 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-Virus: No X-Envelope-From: Received: from mail-lj1-f170.google.com (mail-lj1-f170.google.com [209.85.208.170]) (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 ; Sat, 14 Nov 2020 03:17:52 -0800 (PST) Received: by mail-lj1-f170.google.com with SMTP id i17so12998830ljd.3 for ; Sat, 14 Nov 2020 03:17:52 -0800 (PST) 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=s5vmPalDXBmkU+2RhSubBKaIr4gGtiWFvYaCKkgk8wk=; b=jBANIqDv6ukqf/gD5o54nEGc7NIep150mvB7pWgF/n5DuerIWQ5FYCoBFTxbvFGEhE ZZiAcC88BvVaCrsaRejxbUPtwZ3pnvBJ5dn4PTRMBuZdQJN4jIzrNKtQ5EYb9LCA6BXF AvQZ/gGbdgykW+Nj5MFt6bNazkrwV9lbXUF6vza9l+VSrEYFJgvlVaXDa1WUgADahGiK hQ2QNPwx5CWrFEsXUMZ8KjmhaDochIh7GjpUWGzwCkrgdYLQ3CjoM/V0Cm21iAYY8KBt wL9E7xk3HoIiSacOHfdDubMnf5ro48t2XNu62BEHDtLKcJbjba9zV5BS0/4+nK02NXTQ 0pJg== 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=s5vmPalDXBmkU+2RhSubBKaIr4gGtiWFvYaCKkgk8wk=; b=bcMyQizGPY4WKk/K23s95clf4dxjymu5S0KZ9/3jxmwA3YZL2zLpJwa7dZjFOzyBj7 +qTfYyWXOV3xvNE6Qw/e9KdmMl+etcGfunes21VebWy2dEoaAflFUXJDcq0WMWKPHVcL 1QYHCVvhN6Fh+ONqvMtyGBlp/+He0nMJZCEHVdyyOsxZbyY4U/eh5+UdzndbqOYDwZTw SuDDRkD9ZeALTT/G5alwWcurZzQcQE4brxeLxCSjrUwCKSVrHCahMgCxh8tr16UzhPdy wZICTzydeIwpBAPeCp6V7rVgSV7iIeU6Qp4X85GzhycI8WJdjVwju9w99urm71q5Bdzy 1PUA== X-Gm-Message-State: AOAM5308zD7cJ+zPQQnp8Vptk8jT1jJvxhOOeOXyrDKyg+THvtuztXQw IK5w5CHbziIji0zKATGtqVb8DJPpHxqT1WkPdCU= X-Google-Smtp-Source: ABdhPJw9jJWtxs9cSYD1sZumKIp9djuwBR3fm9W5h1tZ00JnO8A0JM0eVO0Zd9S7Iqujb2N6fitYG/HapjySmO+roMI= X-Received: by 2002:a2e:6a14:: with SMTP id f20mr2534635ljc.377.1605352669548; Sat, 14 Nov 2020 03:17:49 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: Date: Sat, 14 Nov 2020 13:17:38 +0200 Message-ID: To: Marco Pivetta Cc: PHP Internals , Levi Morrison Content-Type: multipart/alternative; boundary="0000000000009b984405b40f4bdd" Subject: Re: [PHP-DEV] Union `&` operator From: zsidelnik@gmail.com (Eugene Sidelnyk) --0000000000009b984405b40f4bdd Content-Type: text/plain; charset="UTF-8" Levi will not have time for this. Who else do you suggest? On Sun, Nov 8, 2020, 6:47 PM Eugene Sidelnyk wrote: > > As for when to allow them: as others have suggested in this thread, keep > it simple for now, and only allow intersection of class/interface > references. > > Yes, I think that single intersection type should support just one class > and any/or any number of interfaces with the condition that they don't > collide with one another. > > > If you want to raise an RFC, special care has to be taken for the > variance in inheritance semantics. > > I don't think neither that I am able to consider all possible impacts to > write the RFC nor implement this, but Levi Morrison (levim@php.net) can. > > On Sun, Nov 8, 2020 at 4:53 PM Marco Pivetta wrote: > >> Hey Eugene, >> >> On Sat, Nov 7, 2020 at 4:13 PM Eugene Sidelnyk >> wrote: >> >>> ```php >>> function foo(A & B & E $object) { >>> // some work >>> >>> var_dump($object); >>> } >>> ``` >>> >> >> Fully support this for parameter, property and return types: already >> making good use of intersection types since a few years. >> >> As for when to allow them: as others have suggested in this thread, keep >> it simple for now, and only allow intersection of class/interface >> references. >> >> If you want to raise an RFC, special care has to be taken for the >> variance in inheritance semantics. >> >> Greets, >> >> Marco Pivetta >> >> http://twitter.com/Ocramius >> >> http://ocramius.github.com/ >> > --0000000000009b984405b40f4bdd--