Re: [RFC] Intersection Types
| From: | Rowan Collins | Date: | Thu, 28 Apr 2016 16:06:01 +0000 |
| Subject: | Re: [RFC] Intersection Types | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-92870@lists.php.net to get a copy of this message | ||
Bob Weinand wrote on 28/04/2016 16:49:
Regarding your suggestion, $foo instanceof Foo & Bar is conflicting with bitwise and here. Anyway, you already can $foo instanceof Foo && $foo instanceof Bar. Which is IMO just as easy, not conflicting and more flexible.It's a shame that that's so verbose. It would be amazing to have something like Perl6's "Junctions": https://perlgeek.de/blog-en.cgi/perl-5-to-6/08-junctions.html $foo instanceof any(Foo, Bar) Well, I can dream... ;)