Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:101376 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 13337 invoked from network); 19 Dec 2017 08:45:06 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Dec 2017 08:45:06 -0000 Authentication-Results: pb1.pair.com header.from=me@kelunik.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=me@kelunik.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain kelunik.com from 81.169.146.218 cause and error) X-PHP-List-Original-Sender: me@kelunik.com X-Host-Fingerprint: 81.169.146.218 mo4-p00-ob.smtp.rzone.de Received: from [81.169.146.218] ([81.169.146.218:28649] helo=mo4-p00-ob.smtp.rzone.de) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 7D/10-10479-E81D83A5 for ; Tue, 19 Dec 2017 03:45:04 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1513673099; s=domk; d=kelunik.com; h=Content-Type:Cc:To:Subject:Message-ID:Date:From:References: In-Reply-To:X-RZG-CLASS-ID:X-RZG-AUTH:From:Subject; bh=eAlQuM3ID1pDudBEWxghtyNBlUdKqSVIHeXiOqrC3xI=; b=RUOAL3MqVvgGeuAE+5UfYS0IO0Xpb+J2PCXxJAnU4MFv9GoZOyFnIqqzJojcOBaS4I B1F5DDwPG4V5WG11IonTHG47Id5AxWHZzF7YvxG0B8Ue5+lsmV+7JTxftS/6l5dS9X5H kb85Ne+Yv5FaPU86vLD5kU3wzKmrKo2Wkewpo= X-RZG-AUTH: :IWkkfkWkbvHsXQGmRYmUo9mlsGbEv0XHBzMIJSS+jKTzde5mDb8AaBUcZiArcA== X-RZG-CLASS-ID: mo00 Received: by mail-yb0-f177.google.com with SMTP id q3so1241386ybg.9 for ; Tue, 19 Dec 2017 00:44:59 -0800 (PST) X-Gm-Message-State: AKGB3mK5Pd7Nlr1zEzUyjSkGnj0BWyoHMtimWvm1oAEoUJbsmyduKWLa WUYnXQUJS3mZTfIp7jVKQsvCXq2kgirG+kW5r1c= X-Google-Smtp-Source: ACJfBotOvgszvHC6v9PK4WsrblH6T1orlwRUdeb7085SP26kQC/fHvYldF2sHT6EZ3MY/d0KCV2vsgK32+Y9bLVJJ14= X-Received: by 10.37.6.194 with SMTP id 185mr1871919ybg.501.1513673098908; Tue, 19 Dec 2017 00:44:58 -0800 (PST) MIME-Version: 1.0 Received: by 10.37.124.71 with HTTP; Tue, 19 Dec 2017 00:44:58 -0800 (PST) In-Reply-To: References: Date: Tue, 19 Dec 2017 09:44:58 +0100 X-Gmail-Original-Message-ID: Message-ID: To: Stanislav Malyshev Cc: Michael Moravec , PHP Internals Content-Type: multipart/alternative; boundary="001a113c57f05ddc890560ad7b4a" Subject: Re: [PHP-DEV] [RFC] Mixed Typehint From: me@kelunik.com (Niklas Keller) --001a113c57f05ddc890560ad7b4a Content-Type: text/plain; charset="UTF-8" > > > 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? Why document code? It contributes nothing to the behavior of the code, well, unless you parse it as annotations. The current one isn't any convention, it's just not possible to do something else. There's nothing that explicitly allows saying "I accept all types", rather than "The type I accept is unspecifed". That said, I'm not sure myself. I guess a more complex type which can't be expressed currently (like a union type) might also use "mixed" then. Regards, Niklas > > mixed, > > it should be easy to eliminate this inconsistency > > There's no "inconsistency" here. > > > and achieve fully type hinted code. > > This is not an "achievement" - adding prefixes for the sake of all > variables having prefixes that mean nothing is not an "achievement". I > do not see any point in it. > -- > Stas Malyshev > smalyshev@gmail.com > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > --001a113c57f05ddc890560ad7b4a--