Skip to content

Commit b9d67f0

Browse files
committed
Promote warning to type error in count()
1 parent 4c2ba38 commit b9d67f0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

ext/standard/array.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -773,7 +773,7 @@ PHP_FUNCTION(count)
773773

774774
switch (Z_TYPE_P(array)) {
775775
case IS_NULL:
776-
php_error_docref(NULL, E_WARNING, "Parameter must be an array or an object that implements Countable");
776+
zend_type_error(NULL, "Parameter must be an array or an object that implements Countable");
777777
RETURN_LONG(0);
778778
break;
779779
case IS_ARRAY:
@@ -804,12 +804,12 @@ PHP_FUNCTION(count)
804804
}
805805

806806
/* If There's no handler and it doesn't implement Countable then add a warning */
807-
php_error_docref(NULL, E_WARNING, "Parameter must be an array or an object that implements Countable");
807+
zend_type_error(NULL, "Parameter must be an array or an object that implements Countable");
808808
RETURN_LONG(1);
809809
break;
810810
}
811811
default:
812-
php_error_docref(NULL, E_WARNING, "Parameter must be an array or an object that implements Countable");
812+
zend_type_error(NULL, "Parameter must be an array or an object that implements Countable");
813813
RETURN_LONG(1);
814814
break;
815815
}

0 commit comments

Comments
 (0)