File tree Expand file tree Collapse file tree 1 file changed +15
-6
lines changed
Expand file tree Collapse file tree 1 file changed +15
-6
lines changed Original file line number Diff line number Diff line change @@ -1612,12 +1612,21 @@ PHP_FUNCTION(array_search)
16121612static inline bool php_in_array (const HashTable * ht , zval * value , bool strict )
16131613{
16141614 if (strict ) {
1615- ZEND_HASH_FOREACH_VAL (ht , /* const */ zval * entry ) {
1616- ZVAL_DEREF (entry );
1617- if (fast_is_identical_function (value , entry )) {
1618- return true;
1619- }
1620- } ZEND_HASH_FOREACH_END ();
1615+ if (Z_TYPE_P (value ) == IS_LONG ) {
1616+ ZEND_HASH_FOREACH_VAL (ht , /* const */ zval * entry ) {
1617+ ZVAL_DEREF (entry );
1618+ if (Z_TYPE_P (entry ) == IS_LONG && Z_LVAL_P (entry ) == Z_LVAL_P (value )) {
1619+ return true;
1620+ }
1621+ } ZEND_HASH_FOREACH_END ();
1622+ } else {
1623+ ZEND_HASH_FOREACH_VAL (ht , /* const */ zval * entry ) {
1624+ ZVAL_DEREF (entry );
1625+ if (fast_is_identical_function (value , entry )) {
1626+ return true;
1627+ }
1628+ } ZEND_HASH_FOREACH_END ();
1629+ }
16211630 } else {
16221631 ZEND_HASH_FOREACH_VAL (ht , /* const */ zval * entry ) {
16231632 ZVAL_DEREF (entry );
You can’t perform that action at this time.
0 commit comments