@@ -6629,6 +6629,11 @@ static zend_result php_array_find(const HashTable *array, zend_fcall_info fci, z
6629
6629
6630
6630
zend_result result = zend_call_function (& fci , & fci_cache );
6631
6631
ZEND_ASSERT (result == SUCCESS );
6632
+ <<<<<<< HEAD
6633
+ == = == ==
6634
+ if (EXPECTED (!Z_ISUNDEF (retval ))) {
6635
+ int retval_true ;
6636
+ >>>>>>> 2701b 97011 (Fix memory leaks in array_any () / array_all ())
6632
6637
6633
6638
if (UNEXPECTED (EG (exception ))) {
6634
6639
return FAILURE ;
@@ -6637,6 +6642,7 @@ static zend_result php_array_find(const HashTable *array, zend_fcall_info fci, z
6637
6642
bool retval_true = zend_is_true (& retval );
6638
6643
zval_ptr_dtor (& retval );
6639
6644
6645
+ <<<<<<< HEAD
6640
6646
/* This negates the condition, if negate_condition is true. Otherwise it does nothing with `retval_true`. */
6641
6647
retval_true ^= negate_condition ;
6642
6648
@@ -6650,6 +6656,10 @@ static zend_result php_array_find(const HashTable *array, zend_fcall_info fci, z
6650
6656
}
6651
6657
6652
6658
break ;
6659
+ = == == ==
6660
+ if (UNEXPECTED (Z_ISUNDEF (retval ))) {
6661
+ return FAILURE ;
6662
+ >>>>>>> 2701b 97011 (Fix memory leaks in array_any () / array_all ())
6653
6663
}
6654
6664
} ZEND_HASH_FOREACH_END ();
6655
6665
@@ -6717,7 +6727,11 @@ PHP_FUNCTION(array_any)
6717
6727
RETURN_THROWS ();
6718
6728
}
6719
6729
6720
- RETURN_BOOL (Z_TYPE_P (return_value ) != IS_UNDEF );
6730
+ bool retval = !Z_ISUNDEF_P (return_value );
6731
+ if (Z_TYPE_P (return_value ) == IS_STRING ) {
6732
+ zval_ptr_dtor_str (return_value );
6733
+ }
6734
+ RETURN_BOOL (retval );
6721
6735
}
6722
6736
/* }}} */
6723
6737
@@ -6737,7 +6751,11 @@ PHP_FUNCTION(array_all)
6737
6751
RETURN_THROWS ();
6738
6752
}
6739
6753
6740
- RETURN_BOOL (Z_TYPE_P (return_value ) == IS_UNDEF );
6754
+ bool retval = Z_ISUNDEF_P (return_value );
6755
+ if (Z_TYPE_P (return_value ) == IS_STRING ) {
6756
+ zval_ptr_dtor_str (return_value );
6757
+ }
6758
+ RETURN_BOOL (retval );
6741
6759
}
6742
6760
/* }}} */
6743
6761
0 commit comments