diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2020-01-07 15:06:36 +0100 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2020-02-17 11:51:09 +0100 |
commit | 43443857b74503246ee4ca25859b302ed0ebc078 (patch) | |
tree | c343eb388a2c3327d8d6d6895c63a8051cb44db9 /ext/reflection/php_reflection.c | |
parent | d2ba8485721144dbb235d183a82e34d8bb1720eb (diff) | |
download | php-git-43443857b74503246ee4ca25859b302ed0ebc078.tar.gz |
Add static return type
RFC: https://wiki.php.net/rfc/static_return_type
The "static" type is represented as MAY_BE_STATIC, rather than
a class type like "self" and "parent", as it has special
resolution semantics, and cannot be cached in the runtime cache.
Closes GH-5062.
Diffstat (limited to 'ext/reflection/php_reflection.c')
-rw-r--r-- | ext/reflection/php_reflection.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index 95c4859e94..8d2d53b028 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -2909,7 +2909,9 @@ ZEND_METHOD(reflection_named_type, isBuiltin) } GET_REFLECTION_OBJECT_PTR(param); - RETVAL_BOOL(ZEND_TYPE_IS_ONLY_MASK(param->type)); + /* Treat "static" as a class type for the purposes of reflection. */ + RETVAL_BOOL(ZEND_TYPE_IS_ONLY_MASK(param->type) + && !(ZEND_TYPE_FULL_MASK(param->type) & MAY_BE_STATIC)); } /* }}} */ |