mirror of
https://github.com/php/php-src.git
synced 2024-12-14 12:26:19 +08:00
Followup fix for bug #75729
The case of overloaded substr() with 3 arguments was not handled.
This commit is contained in:
parent
c72c4c5271
commit
3306577797
@ -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 */
|
||||
|
@ -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"
|
||||
|
Loading…
Reference in New Issue
Block a user