@@ -6170,7 +6170,7 @@ ZEND_METHOD(reflection_reference, fromArrayElement)
6170
6170
}
6171
6171
6172
6172
/* Treat singleton reference as non-reference. */
6173
- if (Z_TYPE_P (item ) != IS_REFERENCE ) {
6173
+ if (Z_TYPE_P (item ) != IS_REFERENCE || Z_REFCOUNT_P ( item ) == 1 ) {
6174
6174
RETURN_NULL ();
6175
6175
}
6176
6176
@@ -6218,30 +6218,6 @@ ZEND_METHOD(reflection_reference, getId)
6218
6218
}
6219
6219
/* }}} */
6220
6220
6221
- /* {{{ proto public int ReflectionReference::getRefcount()
6222
- * Returns reference count of the held reference.
6223
- * ReflectionReference itself increases the refcount, as such:
6224
- * * Refcount 1 indicates that the reference is only held by this ReflectionReference.
6225
- * * Refcount 2 indicates that it is a singleton reference (often not treated as a reference).
6226
- * * Refcount 3 or higher is an ordinary shared reference. */
6227
- ZEND_METHOD (reflection_reference , getRefcount )
6228
- {
6229
- reflection_object * intern ;
6230
-
6231
- if (zend_parse_parameters_none () == FAILURE ) {
6232
- return ;
6233
- }
6234
-
6235
- intern = Z_REFLECTION_P (getThis ());
6236
- if (Z_TYPE (intern -> obj ) != IS_REFERENCE ) {
6237
- _DO_THROW ("Corrupted ReflectionReference object" );
6238
- return ;
6239
- }
6240
-
6241
- RETURN_LONG (Z_REFCOUNT (intern -> obj ));
6242
- }
6243
- /* }}} */
6244
-
6245
6221
/* {{{ method tables */
6246
6222
static const zend_function_entry reflection_exception_functions [] = {
6247
6223
PHP_FE_END
@@ -6730,7 +6706,6 @@ ZEND_END_ARG_INFO()
6730
6706
static const zend_function_entry reflection_reference_functions [] = {
6731
6707
ZEND_ME (reflection_reference , fromArrayElement , arginfo_reflection_reference_fromArrayElement , ZEND_ACC_PUBLIC |ZEND_ACC_STATIC )
6732
6708
ZEND_ME (reflection_reference , getId , arginfo_reflection__void , ZEND_ACC_PUBLIC )
6733
- ZEND_ME (reflection_reference , getRefcount , arginfo_reflection__void , ZEND_ACC_PUBLIC )
6734
6709
6735
6710
/* Always throwing dummy methods */
6736
6711
ZEND_ME (reflection , __clone , arginfo_reflection__void , ZEND_ACC_PRIVATE )
0 commit comments