Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:101389 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 50206 invoked from network); 19 Dec 2017 19:01:29 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Dec 2017 19:01:29 -0000 Authentication-Results: pb1.pair.com smtp.mail=lists@rhsoft.net; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=lists@rhsoft.net; sender-id=pass Received-SPF: pass (pb1.pair.com: domain rhsoft.net designates 91.118.73.15 as permitted sender) X-PHP-List-Original-Sender: lists@rhsoft.net X-Host-Fingerprint: 91.118.73.15 mail.thelounge.net Received: from [91.118.73.15] ([91.118.73.15:44807] helo=mail.thelounge.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 2A/35-10479-902693A5 for ; Tue, 19 Dec 2017 14:01:29 -0500 Received: from srv-rhsoft.rhsoft.net (Authenticated sender: h.reindl@thelounge.net) by mail.thelounge.net (THELOUNGE MTA) with ESMTPSA id 3z1S1K3CnfzXMP for ; Tue, 19 Dec 2017 20:01:25 +0100 (CET) To: internals@lists.php.net References: <3a8054fd-b99f-771f-1f6c-29cf198acdeb@phpgangsta.de> Message-ID: <7d0661d1-c41a-f772-63bb-5296f2fcc62c@rhsoft.net> Date: Tue, 19 Dec 2017 20:01:25 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: de-CH Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC] Mixed Typehint From: lists@rhsoft.net ("lists@rhsoft.net") Am 19.12.2017 um 19:19 schrieb Fleshgrinder: > On 12/19/2017 6:43 PM, Andreas Hennings wrote: >> The argument, which I support, is that "mixed" would allow to >> distinguish against cases of "developer forgot to add a type hint" or >> "no type hint due to legacy / BC reasons". >> Also, with a "mixed" type hint, you know it is not "void" (this is >> still the same argument). > > The developer forgot the type constraint if there is no type constraint in: > > 1. the code > 2. the DocBlock > > This is a simple rule that you can already adopt without any changes to > the language. The thing is that mixed is not required at all at the > moment PHP supports more sophisticated type constructs. As I said > earlier, pursue them, not this. > > PS: It's interesting how people fail to see the power of union and > intersection. This is currently happening on the Kotlin side too. > > A simple example for a union type was already given: `string|int` i see the power and have hundrets of definitions where i would add such hints instead nothing if it would be supported but that's a different thing and both don't collide "It's a simple alias for the current behavior of no type and is fully interchangeable" from this RFC about mixed is completly unrelated to union types