@@ -9277,12 +9277,7 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_COUNT_SPEC_CONST_
9277
9277
zend_object *zobj = Z_OBJ_P(op1);
9278
9278
/* First, check if the handler is defined as it is faster */
9279
9279
if (zobj->handlers->count_elements) {
9280
- if (FAILURE == zobj->handlers->count_elements(zobj, &count)) {
9281
- zend_type_error("Parameter must be an array or an object that implements Countable");
9282
- }
9283
- if (UNEXPECTED(EG(exception))) {
9284
- count = 0;
9285
- }
9280
+ zobj->handlers->count_elements(zobj, &count);
9286
9281
/* Otherwise check if the object implements Countable and call its count() method */
9287
9282
} else if (zend_class_implements_interface(zobj->ce, zend_ce_countable)) {
9288
9283
zval retval;
@@ -16349,12 +16344,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_COUNT_SPEC_TMPVAR_UNUSED_HANDL
16349
16344
zend_object *zobj = Z_OBJ_P(op1);
16350
16345
/* First, check if the handler is defined as it is faster */
16351
16346
if (zobj->handlers->count_elements) {
16352
- if (FAILURE == zobj->handlers->count_elements(zobj, &count)) {
16353
- zend_type_error("Parameter must be an array or an object that implements Countable");
16354
- }
16355
- if (UNEXPECTED(EG(exception))) {
16356
- count = 0;
16357
- }
16347
+ zobj->handlers->count_elements(zobj, &count);
16358
16348
/* Otherwise check if the object implements Countable and call its count() method */
16359
16349
} else if (zend_class_implements_interface(zobj->ce, zend_ce_countable)) {
16360
16350
zval retval;
@@ -45189,12 +45179,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_COUNT_SPEC_CV_UNUSED_HANDLER(Z
45189
45179
zend_object *zobj = Z_OBJ_P(op1);
45190
45180
/* First, check if the handler is defined as it is faster */
45191
45181
if (zobj->handlers->count_elements) {
45192
- if (FAILURE == zobj->handlers->count_elements(zobj, &count)) {
45193
- zend_type_error("Parameter must be an array or an object that implements Countable");
45194
- }
45195
- if (UNEXPECTED(EG(exception))) {
45196
- count = 0;
45197
- }
45182
+ zobj->handlers->count_elements(zobj, &count);
45198
45183
/* Otherwise check if the object implements Countable and call its count() method */
45199
45184
} else if (zend_class_implements_interface(zobj->ce, zend_ce_countable)) {
45200
45185
zval retval;
0 commit comments