> 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, li...@rhsoft.net <li...@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 <le...@php.net> wrote: > On Tue, Dec 19, 2017 at 10:05 AM, Andreas Hennings <andr...@dqxtech.net> > 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. -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php