Skip to content

Commit 5cc4c91

Browse files
committed
Support count_elements, the Countable::count internal representant
1 parent a05b25b commit 5cc4c91

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Zend/zend_API.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4287,6 +4287,10 @@ ZEND_API zend_bool zend_is_countable(zval *countable) /* {{{ */
42874287
case IS_ARRAY:
42884288
return 1;
42894289
case IS_OBJECT:
4290+
if (Z_OBJ_HT_P(countable)->count_elements) {
4291+
return 1;
4292+
}
4293+
42904294
return instanceof_function(Z_OBJCE_P(countable), zend_ce_countable);
42914295
default:
42924296
return 0;

0 commit comments

Comments
 (0)