@@ -376,7 +376,7 @@ static inline void arraylist_object_unset_dimension_helper(arraylist_object *int
376
376
}
377
377
index = Z_LVAL_P (offset );
378
378
379
- if (index < 0 || index >= intern -> array .nSize ) {
379
+ if (index < 0 || index >= intern -> array .nNumUsed ) {
380
380
php_error_docref (NULL , E_NOTICE ,"Index invalid or out of range '%ld'" , index );
381
381
return ;
382
382
} else {
@@ -519,22 +519,7 @@ static zend_object *arraylist_object_new_ex(zend_class_entry *class_type, zval *
519
519
php_error_docref (NULL , E_COMPILE_ERROR , "Internal compiler error, Class is not child of ArrayList" );
520
520
}
521
521
522
- if (inherited ) {
523
- if (class_type -> iterator_funcs .zf_rewind -> common .scope != parent ) {
524
- intern -> flags |= ARRAYLIST_OVERLOADED_REWIND ;
525
- }
526
- if (class_type -> iterator_funcs .zf_valid -> common .scope != parent ) {
527
- intern -> flags |= ARRAYLIST_OVERLOADED_VALID ;
528
- }
529
- if (class_type -> iterator_funcs .zf_key -> common .scope != parent ) {
530
- intern -> flags |= ARRAYLIST_OVERLOADED_KEY ;
531
- }
532
- if (class_type -> iterator_funcs .zf_current -> common .scope != parent ) {
533
- intern -> flags |= ARRAYLIST_OVERLOADED_CURRENT ;
534
- }
535
- if (class_type -> iterator_funcs .zf_next -> common .scope != parent ) {
536
- intern -> flags |= ARRAYLIST_OVERLOADED_NEXT ;
537
- }
522
+ if (inherited ) {
538
523
539
524
intern -> fptr_offset_get = zend_hash_str_find_ptr (& class_type -> function_table , "offsetget" , sizeof ("offsetget" ) - 1 );
540
525
if (intern -> fptr_offset_get -> common .scope == parent ) {
@@ -831,7 +816,12 @@ PHP_MINIT_FUNCTION(arraylist) /* {{{ */ {
831
816
832
817
/* 单个对象的功能 */
833
818
zend_class_implements (array_list_ce , 1 , zend_ce_arrayaccess );
834
- zend_class_implements (array_list_ce , 1 , zend_ce_countable );
819
+
820
+ #if PHP_VERSION_ID > 70200
821
+ zend_class_implements (array_list_ce , 1 , zend_ce_countable );
822
+ #endif
823
+
824
+
835
825
return SUCCESS ;
836
826
}
837
827
/* }}} */
0 commit comments