Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:101417 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 17018 invoked from network); 26 Dec 2017 15:37:10 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Dec 2017 15:37:10 -0000 Authentication-Results: pb1.pair.com smtp.mail=me@kelunik.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=me@kelunik.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain kelunik.com from 81.169.146.163 cause and error) X-PHP-List-Original-Sender: me@kelunik.com X-Host-Fingerprint: 81.169.146.163 mo4-p00-ob.smtp.rzone.de Received: from [81.169.146.163] ([81.169.146.163:18043] helo=mo4-p00-ob.smtp.rzone.de) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 8A/E2-58518-5AC624A5 for ; Tue, 26 Dec 2017 10:37:10 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1514302626; s=domk; d=kelunik.com; h=Content-Type:To:Subject:Message-ID:Date:From:In-Reply-To:References: X-RZG-CLASS-ID:X-RZG-AUTH:From:Subject; bh=e7Ps7TB/kHNXFD06meeWUTAn2EtMQ0pU67Kr37hPYpA=; b=M2Gbd/rEOiU8AtM0oA7zpkCX3SE5C3+0Wzn104I0pTXZpJ7xO5pdbovsojUqWLAZy8 0mpE3uDW37YykJ85M3b9Oo4cQK/kaZa1H1QFb4J4jGDZLI5O2Z0fJP8TD1BFhAw4UXAy ZN2eDiBCuiuUiGfXaldcWUhmQgIit2NbInKAk= X-RZG-AUTH: :IWkkfkWkbvHsXQGmRYmUo9mlsGbEv0XHBzMIJSS+jKTzde5mDb8Db2nURiuzcA== X-RZG-CLASS-ID: mo00 Received: by mail-yw0-f174.google.com with SMTP id n25so6759336ywh.10 for ; Tue, 26 Dec 2017 07:37:06 -0800 (PST) X-Gm-Message-State: AKGB3mKqdZN/vdNyF0AZ45m2Gil4pLEJFBk5WYXvZGUPsA9I+SIg0Kh1 j/CsrncmJ4VRLDvMkxY8i4fLCgp4PfE6iKC6Owo= X-Google-Smtp-Source: ACJfBovxxyuieCZUZwgAwwNvg+FWdajLgIu/IEhOpfy2Nqf3EcdtqXDdpeUmHsHIYT5A5dxi5b7iZwV7rx7g0rmu2Nw= X-Received: by 10.129.49.84 with SMTP id x81mr17194456ywx.191.1514302625325; Tue, 26 Dec 2017 07:37:05 -0800 (PST) MIME-Version: 1.0 References: <72392123-d37b-26df-6886-218f48205f8a@fleshgrinder.com> <5171148a-3554-35a3-ab72-370e1aac4a3f@php.net> In-Reply-To: <5171148a-3554-35a3-ab72-370e1aac4a3f@php.net> Date: Tue, 26 Dec 2017 15:36:54 +0000 X-Gmail-Original-Message-ID: Message-ID: To: PHP Internals Content-Type: multipart/alternative; boundary="001a11407d6810aa1a0561400e70" Subject: Re: [PHP-DEV] [RFC] [DISCUSSION] Scalar Pseudo-type From: me@kelunik.com (Niklas Keller) --001a11407d6810aa1a0561400e70 Content-Type: text/plain; charset="UTF-8" > > Am 24.12.2017 um 15:34 schrieb Fleshgrinder: > > I prepared a PR to add the `scalar` pseudo-type to PHP after the > > discussions around adding a `mixed` pseudo-type. I strongly believe that > > it makes sense to provide the most common primitive union types with > > handy aliases even if we are going to add union types in the future to > PHP. > > Thank you, Richard, for working on this. > > I spent a lot of time this year introducing scalar type declarations into > existing code bases. In quite a few cases I was not able to do so because > the existing code works with parameters that can be of two or more scalar > types. With PHP 7.2, I can only document this outside of the code using > @param annotations (until the code has been refactored to work with only > one parameter type). > > With a "scalar" type declaration I would not have to fall back to @param > annotations and could express the type in actual syntax. > If you want just two of those and not all, you'd still have to use PHPdoc for those? IIRC you voted against union types, which would be a better fit in that case? Regards, Niklas > --001a11407d6810aa1a0561400e70--