Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:101379 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 19280 invoked from network); 19 Dec 2017 10:01:52 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Dec 2017 10:01:52 -0000 Authentication-Results: pb1.pair.com smtp.mail=info@phpgangsta.de; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=info@phpgangsta.de; sender-id=pass Received-SPF: pass (pb1.pair.com: domain phpgangsta.de designates 84.200.8.31 as permitted sender) X-PHP-List-Original-Sender: info@phpgangsta.de X-Host-Fingerprint: 84.200.8.31 phpgangsta.de Received: from [84.200.8.31] ([84.200.8.31:45870] helo=michael01.phpgangsta.de) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 5B/11-10479-D83E83A5 for ; Tue, 19 Dec 2017 05:01:50 -0500 Received: from [192.168.2.19] (ip-2-200-186-228.web.vodafone.de [2.200.186.228]) by michael01.phpgangsta.de (Postfix) with ESMTPSA id 7079E48AA9F for ; Tue, 19 Dec 2017 11:01:46 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=phpgangsta.de; s=mail201210; t=1513677706; bh=iySKBSFc5aRpWTTLDYi4/Y34+VOHos2i7NXnkK8UCJ0=; h=Subject:To:References:From:Date:In-Reply-To; b=bfLluv/vsmADS4cxSyasLjaRWF6Rqt1jEDj3wI3+NcccMk99TUoLKR485R6zUDKdJ HJIzdt3ckEKhqWUhNJsh5ZNY7UHC9VONvcNtEK+xur2uGsEsrC5uvFzvNqrRzymGK9 ODFtuSjvrE5o7q8mzjjXoPrNcT2c/J7ETDKz38VQ= To: internals@lists.php.net References: Message-ID: <3a8054fd-b99f-771f-1f6c-29cf198acdeb@phpgangsta.de> Date: Tue, 19 Dec 2017 11:01:44 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; 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-Transfer-Encoding: 7bit Content-Language: de-DE Subject: Re: [PHP-DEV] [RFC] Mixed Typehint From: info@phpgangsta.de (Michael Kliewe) Am 19.12.2017 um 07:32 schrieb Stanislav Malyshev: > >> I'd like to propose and discuss Mixed Typehint RFC for PHP 7.3: >> https://wiki.php.net/rfc/mixed-typehint >> >> The purpose of this RFC is to introduce "mixed" typehint on language level >> to be used >> as a valid typehint. PHP currently forces users to not use any type in case >> the >> type is mixed/unclear. This makes code inconsistent and less explicit. With > 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? A "mixed" type hint says that it's really "mixed", and the developer who wrote that code did not forget to add a type hint. If you see a place where a type hint is missing, you don't know if it's mixed, or the developer/you missed to write the correct type hint. That's the benefit I see. I would explicitly write "mixed" everywhere in a fully type-hinted codebase, to eliminate this thought while reading: Is it really mixed, or was this place overseen and it's not mixed, but something else... Because it's optional, nobody is hurt, but some people (like me) could add this explicit information. Michael