Followup fix for bug #75729

The case of overloaded substr() with 3 arguments was not handled.
This commit is contained in:
Nikita Popov 2018-03-24 13:15:59 +01:00
parent c72c4c5271
commit 3306577797
2 changed files with 6 additions and 1 deletions

View File

@ -820,7 +820,8 @@ static inline int ct_eval_func_call(
} else if (zend_string_equals_literal(name, "substr")) {
if (Z_TYPE_P(args[0]) != IS_STRING
|| Z_TYPE_P(args[1]) != IS_LONG
|| Z_TYPE_P(args[2]) != IS_LONG) {
|| Z_TYPE_P(args[2]) != IS_LONG
|| (CG(compiler_options) & ZEND_COMPILE_NO_BUILTIN_STRLEN)) {
return FAILURE;
}
/* pass */

View File

@ -9,8 +9,12 @@ mbstring.func_overload=2
<?php
var_dump(strpos("foo", "o"));
var_dump(substr("foo", 1));
var_dump(substr("foo", 1, 1));
?>
--EXPECT--
Deprecated: The mbstring.func_overload directive is deprecated in Unknown on line 0
int(1)
string(2) "oo"
string(1) "o"