Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:101375 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 9130 invoked from network); 19 Dec 2017 07:06:47 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Dec 2017 07:06:47 -0000 Authentication-Results: pb1.pair.com header.from=php@fleshgrinder.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=php@fleshgrinder.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain fleshgrinder.com from 212.232.28.122 cause and error) X-PHP-List-Original-Sender: php@fleshgrinder.com X-Host-Fingerprint: 212.232.28.122 mx201.easyname.com Received: from [212.232.28.122] ([212.232.28.122:59178] helo=mx201.easyname.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 2C/60-04241-38AB83A5 for ; Tue, 19 Dec 2017 02:06:44 -0500 Received: from cable-81-173-135-181.netcologne.de ([81.173.135.181] helo=[192.168.178.20]) by mx.easyname.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1eRByy-0005nz-RL; Tue, 19 Dec 2017 07:06:34 +0000 Reply-To: internals@lists.php.net To: Stanislav Malyshev , Michael Moravec , internals@lists.php.net References: Message-ID: Date: Tue, 19 Dec 2017 08:06:33 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-DNSBL-BARRACUDACENTRAL: YES X-DNSBL-PBLSPAMHAUS: YES X-DNSBL-SPAMRATS: YES Subject: Re: [PHP-DEV] [RFC] Mixed Typehint From: php@fleshgrinder.com (Fleshgrinder) On 12/19/2017 7:32 AM, Stanislav Malyshev wrote: > I'm not sure what's the point of it. "mixed" means "any type". Not > writing a type means "any type". So why waste space and add something > that contributes nothing when everybody is already using the current > convention and the new one does not add anything at all? > I agree with Stanislav here, there is no point in adding this type constraint. Documenting mixed with PhpDoc was required in the past because it was not possible for documentation tools to distinguish between `@param string` and `@param mixed` because there was absolutely no type information available. This has change today, you can ensure that the tools understand your types. What is really needed are `scalar`, `number`, union types, intersection types, and all that together with generics. Note that the situation would be different if our super type (which is `mixed`) would allow for some common action, e.g. `equals`. That is not the case, hence, there is no point in constraining it. Both the super and bottom type (`void`) in PHP are totally behaviorless. -- Richard "Fleshgrinder" Fussenegger