Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:102540 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 46339 invoked from network); 30 Jun 2018 20:17:23 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 30 Jun 2018 20:17:23 -0000 Authentication-Results: pb1.pair.com smtp.mail=php@golemon.com; spf=softfail; sender-id=softfail Authentication-Results: pb1.pair.com header.from=php@golemon.com; sender-id=softfail Received-SPF: softfail (pb1.pair.com: domain golemon.com does not designate 209.85.208.50 as permitted sender) X-PHP-List-Original-Sender: php@golemon.com X-Host-Fingerprint: 209.85.208.50 mail-ed1-f50.google.com Received: from [209.85.208.50] ([209.85.208.50:40663] helo=mail-ed1-f50.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 2F/E2-15351-055E73B5 for ; Sat, 30 Jun 2018 16:17:21 -0400 Received: by mail-ed1-f50.google.com with SMTP id m15-v6so9150921edr.7 for ; Sat, 30 Jun 2018 13:17:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=golemon-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-transfer-encoding; bh=nUSmCtD3aICLdm2Lua6W5xxjYFcYUusBK/KtxyNxk5M=; b=C8WQv4HvufOs1sidnTdzHFrA6IL0cT+CBEgYfR0laTZnk4Dny7Fp3Qqor5ObOU59Lq EuPkp3w695e3YJcwgmVyPVVcDobJHBz2XNO+V1m7Sk3mzI8+eKVV2pk8Oog+b7QZmWnE ZT1lqb5hh4LR8q2bH0tCyDZLaB5hisumjAOhhms0Om2bUo0XTZA3VYYAtogk7NAAQNHb Dh9KPcFjlWTme4mBIBuyby06MdZ98mX0rjKubJVbhEhlY9u72hFFnCQSSiqBgHghYEQH E5n58HpD1rdjtd6/NKis1xg2DOxnFHRPQ90xiRh5sRKBQkuCuQOIXJq9auQ83mqqaFAD yhvw== 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:content-transfer-encoding; bh=nUSmCtD3aICLdm2Lua6W5xxjYFcYUusBK/KtxyNxk5M=; b=GQxwxIz52XzOY09EEUfAyZLFuAyWbuUzfaHDP5k3t+LF0UZOEC+ZruE/azW1hvrhRT XHiYmcqi74fQWCAR5jtfwaFPS1lzVCyGw12iYUYEJwfkQTUZtopsha20xC0XGzbngnEb Ut9GNcCaZ9ACI+5EAqtM/ZX6jOVtv7KNXsoTl861E18i4mVbHzQN+RKyH0GU9oEbE+9B TTgABZ2VptTyk8LgGcMFMHcnTsxGBcWttGjMSg7HT7k9vBz18oJ0cfJ+DjPI/1Y+ZAb0 ERDK4Z9h7KHixwbRITzPQULd8JR6Rur5vSNc68d0j0HIkCXV82y/jOwIPA4jgxa2gIXz oPHg== X-Gm-Message-State: APt69E0ftuQR/btHU4DpYEwWvrbwC4OTlyVXua1//SugpuokcIbYvPd7 HHBbg6oC2bStvpphxD/Q3F+2mwy4DmennXAnPCIWgw== X-Google-Smtp-Source: AAOMgpfKx7cCcytxUEnWtLtL2cn0FSD1wQ2ypOiOYeiDwTvg5kQJpeDsOuQ7rcN+eTGo/XFHyjYMMk36CzOhdrS+cUA= X-Received: by 2002:a50:af84:: with SMTP id h4-v6mr18100177edd.30.1530389837600; Sat, 30 Jun 2018 13:17:17 -0700 (PDT) MIME-Version: 1.0 Sender: php@golemon.com Received: by 2002:a50:8617:0:0:0:0:0 with HTTP; Sat, 30 Jun 2018 13:17:17 -0700 (PDT) X-Originating-IP: [50.201.95.250] In-Reply-To: <854a8dfc-4bc1-c001-a1a7-5347e5483ac8@gmail.com> References: <854a8dfc-4bc1-c001-a1a7-5347e5483ac8@gmail.com> Date: Sat, 30 Jun 2018 15:17:17 -0500 X-Google-Sender-Auth: D7m1ZSO7EUfIdWLa0svyZ1R6VG8 Message-ID: To: Stanislav Malyshev Cc: Gabriel Caruso , PHP Internals Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] [RFC] Mixed type From: pollita@php.net (Sara Golemon) On Sat, Jun 30, 2018 at 3:08 PM, Stanislav Malyshev w= rote: >> Together with Michael Moravec, we=E2=80=99d like to announce that we are= pretending >> to open the Mixed Type RFC (https://wiki.php.net/rfc/mixed-typehint) nex= t >> Monday (02/07) and we=E2=80=99d like to ask you to take a look into the = PR on >> GitHub (https://github.com/php/php-src/pull/2603) and let us know if >> there's something else to do before it. > > I think this is wrong. This "type" - which is not really a type, of > course - does not add anything to the code, by definition - if you take > it out, everything would be the same. Things like that belong in the > documentation. Moreover, it makes the code harder to read, as the reader > should make mental effort to discard this non-type every time it is > mentioned, as it does not carry any information. > I would say that, in a world without union or intersection types, it adds to the readability of the code by explicitly saying, "We accept more than one type here, and we know we accept more than one type here." This is distinct from, "We have no idea what type we accept here." That adds to readability, it doesn't detract. I preface that with a mention of union/intersection types because that seems to be the *actual* problem this RFC is attempting to cope with while lacking the tools to do it right. I'm not super excited about this RFC because, as you say, this information could be easily encoded into the docblock for the function/method. Zero impact to the syntax, same benefit for the programmer and their readability. (More benefit, really, as docblock standards *do* permit union/intersection types. So, complex types maybe? -Sara