diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2019-09-23 16:33:24 +0200 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2019-09-23 16:39:52 +0200 |
commit | 3012d006ff4da73679fca9f0d78a82492fcd0b7a (patch) | |
tree | 8a8d552b816ff7ccc5ea15411929a92c335c050a /Zend/zend_types.h | |
parent | e441378b5422908474863a34cfa6f983a536ce5c (diff) | |
download | php-git-3012d006ff4da73679fca9f0d78a82492fcd0b7a.tar.gz |
Don't set nullability flag for parameters without type
Use value 0 instead. To compensate we check in ReflectionParameter
allowsNull() whether the type is set at all: If it isn't, it always
allows null.
This removes a discrepancy between internal&userland functions:
For userland functions allowsNull() on untyped parameters returned
true, but for internal functions it returned false.
Diffstat (limited to 'Zend/zend_types.h')
-rw-r--r-- | Zend/zend_types.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Zend/zend_types.h b/Zend/zend_types.h index be6c52b8ca..a7fa6fef5a 100644 --- a/Zend/zend_types.h +++ b/Zend/zend_types.h @@ -129,10 +129,10 @@ typedef uintptr_t zend_type; #define _ZEND_TYPE_NULLABLE_BIT Z_L(0x2) #define ZEND_TYPE_IS_SET(t) \ - ((t) > _ZEND_TYPE_FLAG_MASK) + ((t) != 0) #define ZEND_TYPE_IS_MASK(t) \ - (((t) > _ZEND_TYPE_FLAG_MASK) && ((t) <= _ZEND_TYPE_CODE_MAX)) + ((t) <= _ZEND_TYPE_CODE_MAX) #define ZEND_TYPE_IS_CLASS(t) \ ((t) > _ZEND_TYPE_CODE_MAX) @@ -161,6 +161,9 @@ typedef uintptr_t zend_type; #define ZEND_TYPE_WITHOUT_NULL(t) \ ((t) & ~_ZEND_TYPE_NULLABLE_BIT) +#define ZEND_TYPE_ENCODE_NONE() \ + (0) + #define ZEND_TYPE_ENCODE_MASK(maybe_code) \ (maybe_code) |