File tree Expand file tree Collapse file tree 1 file changed +30
-12
lines changed Expand file tree Collapse file tree 1 file changed +30
-12
lines changed Original file line number Diff line number Diff line change @@ -1554,21 +1554,39 @@ static inline void php_search_array(INTERNAL_FUNCTION_PARAMETERS, int behavior)
1554
1554
ZEND_PARSE_PARAMETERS_END ();
1555
1555
1556
1556
if (strict ) {
1557
- ZEND_HASH_FOREACH_KEY_VAL (Z_ARRVAL_P (array ), num_idx , str_idx , entry ) {
1558
- ZVAL_DEREF (entry );
1559
- if (fast_is_identical_function (value , entry )) {
1560
- if (behavior == 0 ) {
1561
- RETURN_TRUE ;
1562
- } else {
1563
- if (str_idx ) {
1564
- RETVAL_STR_COPY (str_idx );
1557
+ if (Z_TYPE_P (value ) == IS_LONG ) {
1558
+ ZEND_HASH_FOREACH_KEY_VAL (Z_ARRVAL_P (array ), num_idx , str_idx , entry ) {
1559
+ ZVAL_DEREF (entry );
1560
+ if (Z_TYPE_P (entry ) == IS_LONG && Z_LVAL_P (entry ) == Z_LVAL_P (value )) {
1561
+ if (behavior == 0 ) {
1562
+ RETURN_TRUE ;
1565
1563
} else {
1566
- RETVAL_LONG (num_idx );
1564
+ if (str_idx ) {
1565
+ RETVAL_STR_COPY (str_idx );
1566
+ } else {
1567
+ RETVAL_LONG (num_idx );
1568
+ }
1569
+ return ;
1567
1570
}
1568
- return ;
1569
1571
}
1570
- }
1571
- } ZEND_HASH_FOREACH_END ();
1572
+ } ZEND_HASH_FOREACH_END ();
1573
+ } else {
1574
+ ZEND_HASH_FOREACH_KEY_VAL (Z_ARRVAL_P (array ), num_idx , str_idx , entry ) {
1575
+ ZVAL_DEREF (entry );
1576
+ if (fast_is_identical_function (value , entry )) {
1577
+ if (behavior == 0 ) {
1578
+ RETURN_TRUE ;
1579
+ } else {
1580
+ if (str_idx ) {
1581
+ RETVAL_STR_COPY (str_idx );
1582
+ } else {
1583
+ RETVAL_LONG (num_idx );
1584
+ }
1585
+ return ;
1586
+ }
1587
+ }
1588
+ } ZEND_HASH_FOREACH_END ();
1589
+ }
1572
1590
} else {
1573
1591
if (Z_TYPE_P (value ) == IS_LONG ) {
1574
1592
ZEND_HASH_FOREACH_KEY_VAL (Z_ARRVAL_P (array ), num_idx , str_idx , entry ) {
You can’t perform that action at this time.
0 commit comments