diff options
Diffstat (limited to 'ext/standard/string.c')
| -rw-r--r-- | ext/standard/string.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/ext/standard/string.c b/ext/standard/string.c index 7b6ad8ed9c..24c3862bf5 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -2469,6 +2469,7 @@ PHP_FUNCTION(substr_replace) if (argc > 3) { if (Z_TYPE_P(len) != IS_ARRAY) { + convert_to_long_ex(len); l = zval_get_long(len); } } else { @@ -2482,12 +2483,12 @@ PHP_FUNCTION(substr_replace) (argc == 3 && Z_TYPE_P(from) == IS_ARRAY) || (argc == 4 && Z_TYPE_P(from) != Z_TYPE_P(len)) ) { - php_error_docref(NULL, E_WARNING, "'from' and 'len' should be of same type - numerical or array "); + php_error_docref(NULL, E_WARNING, "'start' and 'length' should be of same type - numerical or array "); RETURN_STR_COPY(Z_STR_P(str)); } if (argc == 4 && Z_TYPE_P(from) == IS_ARRAY) { if (zend_hash_num_elements(Z_ARRVAL_P(from)) != zend_hash_num_elements(Z_ARRVAL_P(len))) { - php_error_docref(NULL, E_WARNING, "'from' and 'len' should have the same number of elements"); + php_error_docref(NULL, E_WARNING, "'start' and 'length' should have the same number of elements"); RETURN_STR_COPY(Z_STR_P(str)); } } @@ -2559,7 +2560,7 @@ PHP_FUNCTION(substr_replace) } RETURN_NEW_STR(result); } else { - php_error_docref(NULL, E_WARNING, "Functionality of 'from' and 'len' as arrays is not implemented"); + php_error_docref(NULL, E_WARNING, "Functionality of 'start' and 'length' as arrays is not implemented"); RETURN_STR_COPY(Z_STR_P(str)); } } else { /* str is array of strings */ |
