Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:101383 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 35811 invoked from network); 19 Dec 2017 15:28:36 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Dec 2017 15:28:36 -0000 Authentication-Results: pb1.pair.com smtp.mail=morrison.levi@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=morrison.levi@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.128.171 as permitted sender) X-PHP-List-Original-Sender: morrison.levi@gmail.com X-Host-Fingerprint: 209.85.128.171 mail-wr0-f171.google.com Received: from [209.85.128.171] ([209.85.128.171:33295] helo=mail-wr0-f171.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 78/13-10479-120393A5 for ; Tue, 19 Dec 2017 10:28:34 -0500 Received: by mail-wr0-f171.google.com with SMTP id v21so8944075wrc.0 for ; Tue, 19 Dec 2017 07:28:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=d/XxkEUXOzrV+ghiql5KBSSLf+JmTU0vnn7XNA8/iEg=; b=E0dfkoTlZ/snU4qVEzegcbRrZ2hGG1qDWaFv7JpL0e9E6AM2in0Kqd8nL5453QJeso NqTDHyL15ZthK0AWHAftojx7xiE4AC9q1thzr+fuC8jw7ak2gZ+06NoJOnuQa4MnBKUi FcbdAlV5f6iEDt/ggCjc+hF/wNSl8Bj6ffssK8ivk4N8Ek9sDsP9mzb4DPO8bjghL7+x WMVGdM7SgjA6DJuTdiq92FLT9+lr/SQGxRmIcUPUU48f7QL0ueklCysTNJOrmj4JI8if 2xYKicZ6LC/VmFmWVdnSsSar+udg+xFBuG7CsKxdm2Uh3opYclCzhFqfpAUvUY9cv4X/ KnKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=d/XxkEUXOzrV+ghiql5KBSSLf+JmTU0vnn7XNA8/iEg=; b=rjF6JZYDa2qcLdXD2Zcpb7jFHnWtBj1WlwBVEL6H9IO8qtDs4fcRI3XuibSOIDN41X Ehob5KsYeL4cKw8s8E3hfX11UsIS3O5rUxb2DLE8l8r5tDEuDXvT22ri7vCR3d3UDvgG t1kBlyT7TFFP9zSh8SQDBnwf9ygoFunnJ33j9nkAZfHED7xF1RuZZGQ9WmmOw5R3bBj0 Aj2ffQxut00/N7rl5/Y5V3PS0dXeGjswGp6cHTMVGC8t12aR4QRKWdsFHhKaOPX0uMCa pZ8hYAfpRG6hdcZxqdMgSmAWOka+P4gsPOO+hbNeUYr6E1EglINizUHk8nheNKSvtxiT qPow== X-Gm-Message-State: AKGB3mJqc8c9TYFEBxiqB3dmb6zyL5zFf3srXS2/o23tJxQk4l5ayQZC 7HnGAYCxVoG9Nkc1k2AK8GBaXR1ykG7qDeczCXI6DQEs X-Google-Smtp-Source: ACJfBoucqWSz9QggGQkbSWZsoMvoJxkTjiaMkWYLm5tHbKw8uaZJBrPJL8iOvmLSqVPwjc1IR9/uu3e2J6TelE0S5Z0= X-Received: by 10.223.166.120 with SMTP id k111mr5264849wrc.125.1513697309946; Tue, 19 Dec 2017 07:28:29 -0800 (PST) MIME-Version: 1.0 Sender: morrison.levi@gmail.com Received: by 10.28.21.68 with HTTP; Tue, 19 Dec 2017 07:28:29 -0800 (PST) In-Reply-To: References: <3a8054fd-b99f-771f-1f6c-29cf198acdeb@phpgangsta.de> Date: Tue, 19 Dec 2017 08:28:29 -0700 X-Google-Sender-Auth: A9XAYhtOZp4ny-Rdhv6CSvnfkeQ Message-ID: To: Andreas Hennings Cc: Michael Kliewe , PHP internals Content-Type: text/plain; charset="UTF-8" Subject: Re: [PHP-DEV] [RFC] Mixed Typehint From: levim@php.net (Levi Morrison) On Tue, Dec 19, 2017 at 4:47 AM, Andreas Hennings wrote: > On 19 December 2017 at 08:06, Fleshgrinder wrote: >> What is really needed are `scalar`, `number`, union types, intersection >> types, and all that together with generics. > > Do we have ongoing discussions or RFCs for those already? > I know we have one for generics, which seems somehow stuck, > https://wiki.php.net/rfc/generics No. Work is quietly being done on parameterized types (aka generics) here: https://github.com/morrisonlevi/php-src/tree/parameterized_traits There really isn't a lot to discuss at this stage anyway; the technical implementation is paramount. > What would "scalar" mean exactly? string+int+float? Scalar and number are just ways of naming certain union types which feature was already declined. Maybe a single RFC which targets both union and intersection types would pass. Our `is_scalar` function returns true for integer, float, string or boolean; a scalar type should mirror that definition: int | float | string | bool. > I would sometimes like a string+int, for "everything that can be an array key". This is just another named union for `string | int`.