On 5/25/2016 11:37 PM, Stanislav Malyshev wrote: > Hi! > >> We already have the differentiation between IS_NULL and IS_UNDEF, why >> not expose the latter to userland? I mean, JavaScript has it too and >> people are able to understand it. > > IS_UNDEF is not a PHP type, it is an engine implementation flag. Now, > adding a new type "undefined" would be a pretty big thing and then you'd > need to deal with all the implications of it. Including a huge BC break > of changing the type of all uninitialized variables, and the question of > "what if I want my parameter to be able to accept undefined values" and > so on. Huge can of worms, and all of it again just to have a type that > is exactly like null but not null. While the only reason null exists is > to do exactly what "undefined" is proposed to do. >
Andrea already said that we would not use it for untyped properties, hence, no BC. It is not the same as null, very similar, but definitely not the same. Think of it in DB terms: | table | | ----- | | id | SELECT name FROM table; That's not null, it's not defined (undefined, unset, ...). In other words, null is a value and undefined/unset a state. Whether this proposal should become part of this RFC or not is something that needs to be discussed. -- Richard "Fleshgrinder" Fussenegger
signature.asc
Description: OpenPGP digital signature