Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:101387 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 45279 invoked from network); 19 Dec 2017 17:44:21 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Dec 2017 17:44:21 -0000 Authentication-Results: pb1.pair.com header.from=andreas@dqxtech.net; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=andreas@dqxtech.net; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain dqxtech.net from 209.85.215.47 cause and error) X-PHP-List-Original-Sender: andreas@dqxtech.net X-Host-Fingerprint: 209.85.215.47 mail-lf0-f47.google.com Received: from [209.85.215.47] ([209.85.215.47:43926] helo=mail-lf0-f47.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 8C/74-10479-4FF493A5 for ; Tue, 19 Dec 2017 12:44:21 -0500 Received: by mail-lf0-f47.google.com with SMTP id o26so6846202lfc.10 for ; Tue, 19 Dec 2017 09:44:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dqxtech-net.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=XT6k8sWJ/hdn3WlVxTNqn16FeNrJBZsJicb3g0fFeVY=; b=wxFJTR1VsRu1CcQMnDoWFU3k7RWYWfqgGlA2N3HiFK3dhRPg0PWWBkQvZpnUJhDv9I Zm8EnnRNKVDw8Md797l8JOYcnEoX4e4gYmGiJjtvBseZqki6Jqp8mVZHITIjZTqioanX kzzVcTbqZ8i74jF8WtHrQHOvcowx6fS/uaYrt0+yKlQ3rpriA/bQx94fvnxR3Muc+QFY +Lot8WaKpzxKyr0uHySgTn5oWtmhh3elzJ0wMtGgVnAg/dzfRF7qynHNJgARzyBKVut9 cTlNi9Js5dJkjhZ+JEVxcTwMSvq4hEBDx6O8w4xma7OmDWGawmCFcT5G8sj5YocX71PZ NoCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=XT6k8sWJ/hdn3WlVxTNqn16FeNrJBZsJicb3g0fFeVY=; b=gv/naCSDcMVIM9QZOCw/VMYMqAAhwVBVEjbpmwMwKJkTAthihCs0n0UcQOXN+dHfZU Xo+67YCHiy1D0hzFnMcyAAsPL0Zmw/8V3IzlZ3vL/Gkz3Kaiiud1gJnY34vDsDqRC2aN VLIxLyn51rektGdDH75PxldKB42c837U4V3/f56AiGomTkkTn1qGUCp90tHHXhw5/+bm QA+PTbQZ3odouYk4p2XL5/Fn3U6isV3lKoqPCuB8GtzyA1RZGhO1M/BWl82WWQd05pDC S3Cf1fe+4ADYsG1hDjW5U+4nJl9wEMlEEdTrW8EHspCX/qyHulngvOjaZWL5zXzIOG8v HaDQ== X-Gm-Message-State: AKGB3mLBxfh7fp9hpn8N9KMZhOitrb6Z5/Np2FEvhCGrysOu/0VDWfQJ GXsEZSPV1aLT9zs5nFHl9uG4zCFWDBU= X-Google-Smtp-Source: ACJfBot+EgaF8JLsZPzj8nFn+3EE2LXn7oeTFuUePRLlckvgDAWUu06e7kTW75X64Hcf8Uhc4PNp3w== X-Received: by 10.46.93.13 with SMTP id r13mr2945845ljb.102.1513705457036; Tue, 19 Dec 2017 09:44:17 -0800 (PST) Received: from mail-lf0-f53.google.com (mail-lf0-f53.google.com. [209.85.215.53]) by smtp.googlemail.com with ESMTPSA id v17sm3103953ljv.38.2017.12.19.09.44.15 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 Dec 2017 09:44:15 -0800 (PST) Received: by mail-lf0-f53.google.com with SMTP id m20so7980001lfi.6 for ; Tue, 19 Dec 2017 09:44:15 -0800 (PST) X-Received: by 10.46.27.131 with SMTP id c3mr2621406ljf.40.1513705455415; Tue, 19 Dec 2017 09:44:15 -0800 (PST) MIME-Version: 1.0 Received: by 10.25.170.16 with HTTP; Tue, 19 Dec 2017 09:43:54 -0800 (PST) In-Reply-To: References: <3a8054fd-b99f-771f-1f6c-29cf198acdeb@phpgangsta.de> Date: Tue, 19 Dec 2017 18:43:54 +0100 X-Gmail-Original-Message-ID: Message-ID: To: Levi Morrison Cc: Michael Kliewe , PHP internals Content-Type: text/plain; charset="UTF-8" Subject: Re: [PHP-DEV] [RFC] Mixed Typehint From: andreas@dqxtech.net (Andreas Hennings) > For correctness: `callable` is not the union `string | array | object` because only certain kinds of strings, arrays, and objects are accepted. Correct. > this thread is about `mixed` > which I would vote against. As our type-system stands it provides > almost no value 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). On 19 December 2017 at 18:38, lists@rhsoft.net wrote: > IMHO the wrong question, the right ones would be > > a) how much work is it to implement > b) does it any harm > c) is it maintainable and does it bring relevant maintainance cost I think we do need to explain whether a feature "provides value", so Levi's question is not wrong. Simply "does no harm" is not enough. We just disagree on the answer, we actually do think it provides value. On 19 December 2017 at 18:30, Levi Morrison wrote: > On Tue, Dec 19, 2017 at 10:05 AM, Andreas Hennings wrote: >> We already have other "meta" types. >> E.g. "callable" can be a string, an array, an object with __invoke(). >> A "numeric" can be float or int. >> A "iterable" can be an array or an traversable object. > > For correctness: `callable` is not the union `string | array | object` > because only certain kinds of strings, arrays, and objects are > accepted. > >> Personally I don't think we need every possible union, let alone intersections. > > How many do we need to have for us to make the conclusion we should > stop making special-cases in the engine and generalize it? > > In any case we are straying off-topic: this thread is about `mixed` > which I would vote against. As our type-system stands it provides > almost no value. If our type system ever changes and it suddenly > provides value then it should be proposed at that point.