Commit fda3cb0c0ef for php
commit fda3cb0c0ef5c9e66578569c17703a5cd16524f9
Author: Weilin Du <weilindu@php.net>
Date: Sat Oct 17 00:09:47 2026 +0800
ext/standard: Use fast ZPP in levenshtein() (#24369)
diff --git a/ext/standard/levenshtein.c b/ext/standard/levenshtein.c
index efc71d2a282..9ac7689d3bf 100644
--- a/ext/standard/levenshtein.c
+++ b/ext/standard/levenshtein.c
@@ -80,10 +80,14 @@ PHP_FUNCTION(levenshtein)
zend_long cost_rep = 1;
zend_long cost_del = 1;
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "SS|lll", &string1, &string2, &cost_ins, &cost_rep, &cost_del) == FAILURE) {
- RETURN_THROWS();
- }
-
+ ZEND_PARSE_PARAMETERS_START(2, 5)
+ Z_PARAM_STR(string1)
+ Z_PARAM_STR(string2)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_LONG(cost_ins)
+ Z_PARAM_LONG(cost_rep)
+ Z_PARAM_LONG(cost_del)
+ ZEND_PARSE_PARAMETERS_END();
RETURN_LONG(reference_levdist(string1, string2, cost_ins, cost_rep, cost_del));
}