Re: [RFC] Mixed type
| From: | Máté Kocsis | Date: | Mon, 20 Apr 2020 15:46:37 +0000 |
| Subject: | Re: [RFC] Mixed type | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-109722@lists.php.net to get a copy of this message | ||
Hi Larry,
> Sure, but how often is that an actual description of what the code
> accepts? I... cannot actually envision what code would actually accept
> that mess. :-)
>
For example the recently added get_debug_type() function does, along with
dozens of internal functions. Besides messy code, I'm sure that there are
legitimate use-cases for the mixed type in user-land as well.
use mixed = null|bool|int|float|string|array|object|resource;
> use scalar = null|bool|int|float|string;
> use number = int|float;
I'm really not a fan of type aliases (at least user-land ones), but I also
agree with Sara that these 3 "global" aliases would come handy. Actually, I
was considering to also propose "scalar" and "number" in a later RFC.
Cheers,
Máté