Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:92280 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 98324 invoked from network); 14 Apr 2016 08:52:04 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Apr 2016 08:52:04 -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.214.169 as permitted sender) X-PHP-List-Original-Sender: cornelius.howl@gmail.com X-Host-Fingerprint: 209.85.214.169 mail-ob0-f169.google.com Received: from [209.85.214.169] ([209.85.214.169:35696] helo=mail-ob0-f169.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A4/63-12455-33A5F075 for ; Thu, 14 Apr 2016 04:52:03 -0400 Received: by mail-ob0-f169.google.com with SMTP id k9so45513951obk.2 for ; Thu, 14 Apr 2016 01:52:03 -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=iJB2IsZZXMBfBncPdimXVgA+1SZiodUGK5G3wAtohxs=; b=AatoikR4tJUvP0xtEq/p4AlVW3ClZ0T5shZqpw3FA+quOsb8awunLU5fiXddYQp1BV 2SwPxxuH/KDsXzAjCvJlDhyDbeEfJYolqefzkbEB/YCEUYDxPgAc8Q8vCxwccWM/1He/ yh5nCnzEayryqH9GUX4qehyPJATzYv5k0YJ+CYtspRa490HI5DWZqt2FBEKwDKui94FQ wYM4UY5PIPornipl0rNP8RViQlyfgbcOkbXUyk+gBaGwYlTZ7FJoEpk1qFLqPMKdoFF+ 6YMAOEV4xqpmxIqcnwtpjxsFhiKmmHwPmhwJ7+ab6hP8OrJ/XzcR41oRj5SmDkWhdud9 NWwA== 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=iJB2IsZZXMBfBncPdimXVgA+1SZiodUGK5G3wAtohxs=; b=L/ot39SkiHxS0FqXqoQMgIKg1qBJgdocicFrZysQbuCw9gJz43OLvWXfRiaC7Ujjc/ CggwxEPvSTqzoaPb1o/0R6BqvDWaq8eDjZj9ozcfknkOOZQs4AYOOIqGRFPnNLE/57M3 6PvGVuE0ETxLyX4Co47BqJLGwC6er3dS+vBvPg4ANc/QHNJnsmKOfUjAe4bH2K5QJUuZ 2BUSUi3Y47BhNsAwlKErqx5l8HU2rWoxEAIDPsZs7ekYsyQbg8nuPqA2xQLPCP2kRHa/ RFcSQ62/cVu7pb11mXvMgvuOj9z/qtLzsSCN2e/u0qetGF3j6K7fgE8ig1prWE8kmF/I Cf+w== X-Gm-Message-State: AOPr4FWAV3d/R9syEcFpSo2E/2R5JEomTks63wqIGDNHFPg7XqlAyrj8LZYxUFpPTTZUQS4kZETghbYFt83ESw== MIME-Version: 1.0 X-Received: by 10.182.96.42 with SMTP id dp10mr7028309obb.50.1460623920732; Thu, 14 Apr 2016 01:52:00 -0700 (PDT) Received: by 10.157.7.194 with HTTP; Thu, 14 Apr 2016 01:52:00 -0700 (PDT) In-Reply-To: References: Date: Thu, 14 Apr 2016 16:52:00 +0800 Message-ID: To: Dmitry Stogov Cc: Levi Morrison , internals Content-Type: multipart/alternative; boundary=001a11c23036f23a6f05306e01b3 Subject: Re: [PHP-DEV] [RFC] Union Types From: cornelius.howl@gmail.com (Lin Yo-An) --001a11c23036f23a6f05306e01b3 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable I think this will add more complexity to the runtime system. The type hinting will be something we use to generate good JIT code, not just for checking types. Dmitry Stogov =E6=96=BC 2016=E5=B9=B44=E6=9C=8814=E6=97= =A5 =E6=98=9F=E6=9C=9F=E5=9B=9B=E5=AF=AB=E9=81=93=EF=BC=9A > The RFC doesn't say anything about support for multiple class names. > > function foo(A|B|C $x) > > Support for multiple classes would lead to complex implementation. > > Thanks. Dmitry. > > ________________________________________ > From: Levi Morrison > > Sent: Thursday, April 14, 2016 06:46 > To: internals > Subject: [PHP-DEV] [RFC] Union Types > > As alluded to in an earlier email today[1] I am now moving the Union > Types RFC[2] to the discussion phase. The short summary of the RFC is > that it permits a type declaration to be one of several enumerated > types. For example, this is a potential signature for a multi-type map > routine: > > function map(callable $f, Array | Traversable $iterable); > > The second parameter `$iterable` is required to be of type Array or > Traversable - any other type will error. > > I look forward to a helpful and meaningful discussion! > > [1]: http://news.php.net/php.internals/92252 > [2]: https://wiki.php.net/rfc/union_types > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > --=20 Sent from Gmail Mobile --001a11c23036f23a6f05306e01b3--