@@ -9265,12 +9265,7 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_COUNT_SPEC_CONST_
9265
9265
zend_object *zobj = Z_OBJ_P(op1);
9266
9266
/* First, check if the handler is defined as it is faster */
9267
9267
if (zobj->handlers->count_elements) {
9268
- if (FAILURE == zobj->handlers->count_elements(zobj, &count)) {
9269
- zend_type_error("Parameter must be an array or an object that implements Countable");
9270
- }
9271
- if (UNEXPECTED(EG(exception))) {
9272
- count = 0;
9273
- }
9268
+ zobj->handlers->count_elements(zobj, &count);
9274
9269
/* Otherwise check if the object implements Countable and call its count() method */
9275
9270
} else if (zend_class_implements_interface(zobj->ce, zend_ce_countable)) {
9276
9271
zval retval;
@@ -16280,12 +16275,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_COUNT_SPEC_TMPVAR_UNUSED_HANDL
16280
16275
zend_object *zobj = Z_OBJ_P(op1);
16281
16276
/* First, check if the handler is defined as it is faster */
16282
16277
if (zobj->handlers->count_elements) {
16283
- if (FAILURE == zobj->handlers->count_elements(zobj, &count)) {
16284
- zend_type_error("Parameter must be an array or an object that implements Countable");
16285
- }
16286
- if (UNEXPECTED(EG(exception))) {
16287
- count = 0;
16288
- }
16278
+ zobj->handlers->count_elements(zobj, &count);
16289
16279
/* Otherwise check if the object implements Countable and call its count() method */
16290
16280
} else if (zend_class_implements_interface(zobj->ce, zend_ce_countable)) {
16291
16281
zval retval;
@@ -45070,12 +45060,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_COUNT_SPEC_CV_UNUSED_HANDLER(Z
45070
45060
zend_object *zobj = Z_OBJ_P(op1);
45071
45061
/* First, check if the handler is defined as it is faster */
45072
45062
if (zobj->handlers->count_elements) {
45073
- if (FAILURE == zobj->handlers->count_elements(zobj, &count)) {
45074
- zend_type_error("Parameter must be an array or an object that implements Countable");
45075
- }
45076
- if (UNEXPECTED(EG(exception))) {
45077
- count = 0;
45078
- }
45063
+ zobj->handlers->count_elements(zobj, &count);
45079
45064
/* Otherwise check if the object implements Countable and call its count() method */
45080
45065
} else if (zend_class_implements_interface(zobj->ce, zend_ce_countable)) {
45081
45066
zval retval;
0 commit comments