@@ -9233,12 +9233,7 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_COUNT_SPEC_CONST_
9233
9233
zend_object *zobj = Z_OBJ_P(op1);
9234
9234
/* First, check if the handler is defined as it is faster */
9235
9235
if (zobj->handlers->count_elements) {
9236
- if (FAILURE == zobj->handlers->count_elements(zobj, &count)) {
9237
- zend_type_error("Parameter must be an array or an object that implements Countable");
9238
- }
9239
- if (UNEXPECTED(EG(exception))) {
9240
- count = 0;
9241
- }
9236
+ zobj->handlers->count_elements(zobj, &count);
9242
9237
/* Otherwise check if the object implements Countable and call its count() method */
9243
9238
} else if (zend_class_implements_interface(zobj->ce, zend_ce_countable)) {
9244
9239
zval retval;
@@ -16248,12 +16243,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_COUNT_SPEC_TMPVAR_UNUSED_HANDL
16248
16243
zend_object *zobj = Z_OBJ_P(op1);
16249
16244
/* First, check if the handler is defined as it is faster */
16250
16245
if (zobj->handlers->count_elements) {
16251
- if (FAILURE == zobj->handlers->count_elements(zobj, &count)) {
16252
- zend_type_error("Parameter must be an array or an object that implements Countable");
16253
- }
16254
- if (UNEXPECTED(EG(exception))) {
16255
- count = 0;
16256
- }
16246
+ zobj->handlers->count_elements(zobj, &count);
16257
16247
/* Otherwise check if the object implements Countable and call its count() method */
16258
16248
} else if (zend_class_implements_interface(zobj->ce, zend_ce_countable)) {
16259
16249
zval retval;
@@ -44805,12 +44795,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_COUNT_SPEC_CV_UNUSED_HANDLER(Z
44805
44795
zend_object *zobj = Z_OBJ_P(op1);
44806
44796
/* First, check if the handler is defined as it is faster */
44807
44797
if (zobj->handlers->count_elements) {
44808
- if (FAILURE == zobj->handlers->count_elements(zobj, &count)) {
44809
- zend_type_error("Parameter must be an array or an object that implements Countable");
44810
- }
44811
- if (UNEXPECTED(EG(exception))) {
44812
- count = 0;
44813
- }
44798
+ zobj->handlers->count_elements(zobj, &count);
44814
44799
/* Otherwise check if the object implements Countable and call its count() method */
44815
44800
} else if (zend_class_implements_interface(zobj->ce, zend_ce_countable)) {
44816
44801
zval retval;
0 commit comments