Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:92378 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 12479 invoked from network); 17 Apr 2016 10:28:13 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Apr 2016 10:28:13 -0000 Authentication-Results: pb1.pair.com smtp.mail=cornelius.howl@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=cornelius.howl@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.218.52 as permitted sender) X-PHP-List-Original-Sender: cornelius.howl@gmail.com X-Host-Fingerprint: 209.85.218.52 mail-oi0-f52.google.com Received: from [209.85.218.52] ([209.85.218.52:35053] helo=mail-oi0-f52.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id CC/D8-32052-B3563175 for ; Sun, 17 Apr 2016 06:28:11 -0400 Received: by mail-oi0-f52.google.com with SMTP id p188so162474110oih.2 for ; Sun, 17 Apr 2016 03:28:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=hmTiQOMSC8rfTMqbQeshs+IFPd4vOSPAYQSWmfT78O0=; b=LVxOXmpfb3NooaXmGW4J2RDlpdIOM9rftuX0Oq7CcCG11rN73l/8JmK2epQ+ZftzY8 1juMAAkh8zzjIHGapqVFNyGV0uL2jdiU2xerB8RLFuPe5U/e6d98M3VBGy1TSct3PmiN TpNjIRtsDahKJ+elZWQgVKpK2YD7PpbPteD5Te3Llj/NdRoACVIopBw6QfFZBevmqzRW KvTu3lvHB0/tPgcnCOoKMxgAgkKJ87O9Z+aYmpP8+9R4FLycMprnVbC0jCkUPuxpWET0 5jXUKi1w5b4cULXzFIuNapUJfQkvTSxMqpr8x+b+2H8MpjgUCzFFnFtsxjMaMAS8dDjg 7ARw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=hmTiQOMSC8rfTMqbQeshs+IFPd4vOSPAYQSWmfT78O0=; b=j+vVhS60YhLead7SPRzZYJDmTRj3yy7Rnvgjpvkj6akJqbU3wDZaH8cF8Hr4da8jB3 ZvtXkxRQLsBLZU3sJA11Z4XCRPexwmQwbx+jxOoeeA7jZr14ZVBc1RDHYGlykBpAksyi W7SZZwq1Tbv2PASbvKzJlRrvO57hapQktPRmte2U6fRzdmt65DUngvL2v8cA64SoTSjY 8yB7mEJuXgl7yfH8HcbTR/s9kAAiTpaxnGGnInIi/xTC5YK3x7O79r+RcBOzdB2mrQDM denbOV4QEwP24ysqSpRWj/257usZdCBDfj9vDaI76JmLAEuPQ7PLoSeaUgCp5TPPI+kR FFJw== X-Gm-Message-State: AOPr4FUG/Cd1ySXWW7huaSOzLclhyt5kAgaM7f5qOzhS5Aeo7BU5RwM/ih3t8wgzAhKFi1IGpV7XsryzU9fAdQ== MIME-Version: 1.0 X-Received: by 10.202.83.75 with SMTP id h72mr13421077oib.121.1460888888349; Sun, 17 Apr 2016 03:28:08 -0700 (PDT) Received: by 10.157.7.194 with HTTP; Sun, 17 Apr 2016 03:28:08 -0700 (PDT) In-Reply-To: <57126511.1010801@telia.com> References: <57126511.1010801@telia.com> Date: Sun, 17 Apr 2016 18:28:08 +0800 Message-ID: To: =?UTF-8?Q?Bj=C3=B6rn_Larsson?= Cc: Levi Morrison , Derick Rethans , PHP internals Content-Type: multipart/alternative; boundary=001a113de8e43f29ab0530abb34c Subject: Re: [PHP-DEV] [RFC] Union Types From: cornelius.howl@gmail.com (Lin Yo-An) --001a113de8e43f29ab0530abb34c Content-Type: text/plain; charset=UTF-8 I think it will be better if union type is only allowed in the "type" statement, like what you described in your RFC. type Iterable = Array | Traversable; If we can always pre-define the types. And only allow just one type for each function parameter in the function prototype, then, I think the performance impact of type checking in the runtime might be able to be reduced. In other words, you predefine the union type before you used them, and the union types can be reused in different functions, you don't write a lot union type in function prototype. --001a113de8e43f29ab0530abb34c--