@@ -9272,12 +9272,7 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_COUNT_SPEC_CONST_
9272
9272
zend_object *zobj = Z_OBJ_P(op1);
9273
9273
/* First, check if the handler is defined as it is faster */
9274
9274
if (zobj->handlers->count_elements) {
9275
- if (FAILURE == zobj->handlers->count_elements(zobj, &count)) {
9276
- zend_type_error("Parameter must be an array or an object that implements Countable");
9277
- }
9278
- if (UNEXPECTED(EG(exception))) {
9279
- count = 0;
9280
- }
9275
+ zobj->handlers->count_elements(zobj, &count);
9281
9276
/* Otherwise check if the object implements Countable and call its count() method */
9282
9277
} else if (zend_class_implements_interface(zobj->ce, zend_ce_countable)) {
9283
9278
zval retval;
@@ -16281,12 +16276,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_COUNT_SPEC_TMPVAR_UNUSED_HANDL
16281
16276
zend_object *zobj = Z_OBJ_P(op1);
16282
16277
/* First, check if the handler is defined as it is faster */
16283
16278
if (zobj->handlers->count_elements) {
16284
- if (FAILURE == zobj->handlers->count_elements(zobj, &count)) {
16285
- zend_type_error("Parameter must be an array or an object that implements Countable");
16286
- }
16287
- if (UNEXPECTED(EG(exception))) {
16288
- count = 0;
16289
- }
16279
+ zobj->handlers->count_elements(zobj, &count);
16290
16280
/* Otherwise check if the object implements Countable and call its count() method */
16291
16281
} else if (zend_class_implements_interface(zobj->ce, zend_ce_countable)) {
16292
16282
zval retval;
@@ -45041,12 +45031,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_COUNT_SPEC_CV_UNUSED_HANDLER(Z
45041
45031
zend_object *zobj = Z_OBJ_P(op1);
45042
45032
/* First, check if the handler is defined as it is faster */
45043
45033
if (zobj->handlers->count_elements) {
45044
- if (FAILURE == zobj->handlers->count_elements(zobj, &count)) {
45045
- zend_type_error("Parameter must be an array or an object that implements Countable");
45046
- }
45047
- if (UNEXPECTED(EG(exception))) {
45048
- count = 0;
45049
- }
45034
+ zobj->handlers->count_elements(zobj, &count);
45050
45035
/* Otherwise check if the object implements Countable and call its count() method */
45051
45036
} else if (zend_class_implements_interface(zobj->ce, zend_ce_countable)) {
45052
45037
zval retval;
0 commit comments