On Tue, Apr 21, 2020 at 11:10 AM Côme Chilliet <come.chill...@fusiondirectory.org> wrote: > > Le lundi 20 avril 2020, 09:15:24 CEST Sara Golemon a écrit : > > use mixed = null|bool|int|float|string|array|object|resource; > > use scalar = null|bool|int|float|string; > > I’m wondering if null should maybe be left out of these, since ?mixed and > ?scalar can be used for this?
For mixed, this has been discussed several times, it's defined as the union of *all* value types (void aside), *including* null, according to its usage in phpDoc (and in Hack, which also has a nonnull type such that mixed is equivalent to ?nonnull, cf https://docs.hhvm.com/hack/types/nullable-types). For scalar, I already replied (https://externals.io/message/109715#109723) that it should not include null indeed (according to https://www.php.net/manual/en/language.types.intro.php and https://www.php.net/manual/en/function.is-scalar.php). -- Guilliam Xavier -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php