@@ -4018,7 +4018,7 @@ PHP_FUNCTION(array_count_values)
4018
4018
}
4019
4019
/* }}} */
4020
4020
4021
- static inline zval * array_column_fetch_prop (zval * data , zend_string * name_str , zend_long name_long , zval * rv ) /* {{{ */
4021
+ static inline zval * array_column_fetch_prop (zval * data , zend_string * name_str , zend_long name_long , void * * cache_slot , zval * rv ) /* {{{ */
4022
4022
{
4023
4023
zval * prop = NULL ;
4024
4024
@@ -4033,9 +4033,9 @@ static inline zval *array_column_fetch_prop(zval *data, zend_string *name_str, z
4033
4033
/* The has_property check is first performed in "exists" mode (which returns true for
4034
4034
* properties that are null but exist) and then in "has" mode to handle objects that
4035
4035
* implement __isset (which is not called in "exists" mode). */
4036
- if (Z_OBJ_HANDLER_P (data , has_property )(Z_OBJ_P (data ), tmp_str , ZEND_PROPERTY_EXISTS , NULL )
4037
- || Z_OBJ_HANDLER_P (data , has_property )(Z_OBJ_P (data ), tmp_str , ZEND_PROPERTY_ISSET , NULL )) {
4038
- prop = Z_OBJ_HANDLER_P (data , read_property )(Z_OBJ_P (data ), tmp_str , BP_VAR_R , NULL , rv );
4036
+ if (Z_OBJ_HANDLER_P (data , has_property )(Z_OBJ_P (data ), tmp_str , ZEND_PROPERTY_EXISTS , cache_slot )
4037
+ || Z_OBJ_HANDLER_P (data , has_property )(Z_OBJ_P (data ), tmp_str , ZEND_PROPERTY_ISSET , cache_slot )) {
4038
+ prop = Z_OBJ_HANDLER_P (data , read_property )(Z_OBJ_P (data ), tmp_str , BP_VAR_R , cache_slot , rv );
4039
4039
if (prop ) {
4040
4040
ZVAL_DEREF (prop );
4041
4041
if (prop != rv ) {
@@ -4081,6 +4081,9 @@ PHP_FUNCTION(array_column)
4081
4081
Z_PARAM_STR_OR_LONG_OR_NULL (index_str , index_long , index_is_null )
4082
4082
ZEND_PARSE_PARAMETERS_END ();
4083
4083
4084
+ void * cache_slot_column [3 ] = { NULL , NULL , NULL };
4085
+ void * cache_slot_index [3 ] = { NULL , NULL , NULL };
4086
+
4084
4087
array_init_size (return_value , zend_hash_num_elements (input )) ;
4085
4088
/* Index param is not passed */
4086
4089
if (index_is_null ) {
@@ -4091,7 +4094,7 @@ PHP_FUNCTION(array_column)
4091
4094
if (column_is_null ) {
4092
4095
Z_TRY_ADDREF_P (data );
4093
4096
colval = data ;
4094
- } else if ((colval = array_column_fetch_prop (data , column_str , column_long , & rv )) == NULL ) {
4097
+ } else if ((colval = array_column_fetch_prop (data , column_str , column_long , cache_slot_column , & rv )) == NULL ) {
4095
4098
continue ;
4096
4099
}
4097
4100
ZEND_HASH_FILL_ADD (colval );
@@ -4104,12 +4107,12 @@ PHP_FUNCTION(array_column)
4104
4107
if (column_is_null ) {
4105
4108
Z_TRY_ADDREF_P (data );
4106
4109
colval = data ;
4107
- } else if ((colval = array_column_fetch_prop (data , column_str , column_long , & rv )) == NULL ) {
4110
+ } else if ((colval = array_column_fetch_prop (data , column_str , column_long , cache_slot_column , & rv )) == NULL ) {
4108
4111
continue ;
4109
4112
}
4110
4113
4111
4114
zval rv ;
4112
- zval * keyval = array_column_fetch_prop (data , index_str , index_long , & rv );
4115
+ zval * keyval = array_column_fetch_prop (data , index_str , index_long , cache_slot_index , & rv );
4113
4116
if (keyval ) {
4114
4117
array_set_zval_key (Z_ARRVAL_P (return_value ), keyval , colval );
4115
4118
zval_ptr_dtor (colval );
0 commit comments