Skip to content

Commit 30b482f

Browse files
committed
Use RETURN_THROWS()
1 parent e7e758c commit 30b482f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

ext/standard/array.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -773,7 +773,7 @@ PHP_FUNCTION(count)
773773
count = php_count_recursive(array);
774774
} else {
775775
zend_value_error("Mode value is invalid");
776-
return;
776+
RETURN_THROWS();
777777
}
778778
RETURN_LONG(count);
779779
}
@@ -783,7 +783,7 @@ PHP_FUNCTION(count)
783783
&countable, &mode) == SUCCESS) {
784784
if (mode != COUNT_NORMAL && mode != COUNT_RECURSIVE) {
785785
zend_value_error("Mode value is invalid");
786-
return;
786+
RETURN_THROWS();
787787
}
788788
/* First, check if the handler is defined as it is faster */
789789
if (Z_OBJ_HT_P(countable)->count_elements) {
@@ -792,7 +792,7 @@ PHP_FUNCTION(count)
792792
return;
793793
}
794794
if (EG(exception)) {
795-
return;
795+
RETURN_THROWS();
796796
}
797797
}
798798

@@ -808,7 +808,7 @@ PHP_FUNCTION(count)
808808
}
809809
}
810810
zend_type_error("Parameter must be an array or an object that implements Countable");
811-
return;
811+
RETURN_THROWS();
812812
}
813813
/* }}} */
814814

0 commit comments

Comments
 (0)