diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2019-05-09 12:02:16 +0200 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2019-05-09 12:02:16 +0200 |
commit | 54be40113d77f41cbf5a5078a265279140511c52 (patch) | |
tree | 62510e0ce2f0a3b411f9a7aa32889bf9f457cfcd /ext/reflection/php_reflection.c | |
parent | 3c92b79ea056543ad711a9ad3a042847dd0904a2 (diff) | |
download | php-git-54be40113d77f41cbf5a5078a265279140511c52.tar.gz |
Fixed bug #77951
Treat singleton references as non-references in ReflectionReference
and return null for them.
Diffstat (limited to 'ext/reflection/php_reflection.c')
-rw-r--r-- | ext/reflection/php_reflection.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index 31c9fcc51b..da459e60be 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -6176,7 +6176,8 @@ ZEND_METHOD(reflection_reference, fromArrayElement) return; } - if (Z_TYPE_P(item) != IS_REFERENCE) { + /* Treat singleton reference as non-reference. */ + if (Z_TYPE_P(item) != IS_REFERENCE || Z_REFCOUNT_P(item) == 1) { RETURN_NULL(); } |