mirror of
https://github.com/php/php-src.git
synced 2025-01-22 11:44:09 +08:00
- New parameter parsing API
This commit is contained in:
parent
4b77c2baa5
commit
7319fb687e
@ -265,8 +265,9 @@ static void php_ereg_eprint(int err, regex_t *re) {
|
||||
static void php_ereg(INTERNAL_FUNCTION_PARAMETERS, int icase)
|
||||
{
|
||||
zval **regex, /* Regular expression */
|
||||
**findin, /* String to apply expression to */
|
||||
**array = NULL; /* Optional register array */
|
||||
char *findin; /* String to apply expression to */
|
||||
int findin_len;
|
||||
regex_t re;
|
||||
regmatch_t *subs;
|
||||
int err, match_len, string_len;
|
||||
@ -276,25 +277,27 @@ static void php_ereg(INTERNAL_FUNCTION_PARAMETERS, int icase)
|
||||
char *buf = NULL;
|
||||
char *string = NULL;
|
||||
int argc = ZEND_NUM_ARGS();
|
||||
|
||||
if (argc < 2 || argc > 3 ||
|
||||
zend_get_parameters_ex(argc, ®ex, &findin, &array) == FAILURE) {
|
||||
WRONG_PARAM_COUNT;
|
||||
|
||||
if (zend_parse_parameters(argc TSRMLS_CC, "Zs|Z", ®ex, &findin, &findin_len, &array) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (icase)
|
||||
if (icase) {
|
||||
copts |= REG_ICASE;
|
||||
}
|
||||
|
||||
if (argc == 2)
|
||||
if (argc == 2) {
|
||||
copts |= REG_NOSUB;
|
||||
}
|
||||
|
||||
/* compile the regular expression from the supplied regex */
|
||||
if (Z_TYPE_PP(regex) == IS_STRING) {
|
||||
err = regcomp(&re, Z_STRVAL_PP(regex), REG_EXTENDED | copts);
|
||||
} else {
|
||||
/* we convert numbers to integers and treat them as a string */
|
||||
if (Z_TYPE_PP(regex) == IS_DOUBLE)
|
||||
if (Z_TYPE_PP(regex) == IS_DOUBLE) {
|
||||
convert_to_long_ex(regex); /* get rid of decimal places */
|
||||
}
|
||||
convert_to_string_ex(regex);
|
||||
/* don't bother doing an extended regex with just a number */
|
||||
err = regcomp(&re, Z_STRVAL_PP(regex), copts);
|
||||
@ -306,8 +309,7 @@ static void php_ereg(INTERNAL_FUNCTION_PARAMETERS, int icase)
|
||||
}
|
||||
|
||||
/* make a copy of the string we're looking in */
|
||||
convert_to_string_ex(findin);
|
||||
string = estrndup(Z_STRVAL_PP(findin), Z_STRLEN_PP(findin));
|
||||
string = estrndup(findin, findin_len);
|
||||
|
||||
/* allocate storage for (sub-)expression-matches */
|
||||
subs = (regmatch_t *)ecalloc(sizeof(regmatch_t),re.re_nsub+1);
|
||||
@ -324,7 +326,7 @@ static void php_ereg(INTERNAL_FUNCTION_PARAMETERS, int icase)
|
||||
|
||||
if (array && err != REG_NOMATCH) {
|
||||
match_len = (int) (subs[0].rm_eo - subs[0].rm_so);
|
||||
string_len = Z_STRLEN_PP(findin) + 1;
|
||||
string_len = findin_len + 1;
|
||||
|
||||
buf = emalloc(string_len);
|
||||
|
||||
@ -523,23 +525,23 @@ PHPAPI char *php_ereg_replace(const char *pattern, const char *replace, const ch
|
||||
static void php_do_ereg_replace(INTERNAL_FUNCTION_PARAMETERS, int icase)
|
||||
{
|
||||
zval **arg_pattern,
|
||||
**arg_replace,
|
||||
**arg_string;
|
||||
char *pattern;
|
||||
**arg_replace;
|
||||
char *pattern, *arg_string;
|
||||
char *string;
|
||||
char *replace;
|
||||
char *ret;
|
||||
int arg_string_len;
|
||||
|
||||
if (ZEND_NUM_ARGS() != 3 ||
|
||||
zend_get_parameters_ex(3, &arg_pattern, &arg_replace, &arg_string) == FAILURE) {
|
||||
WRONG_PARAM_COUNT;
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ZZs", &arg_pattern, &arg_replace, &arg_string, &arg_string_len) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (Z_TYPE_PP(arg_pattern) == IS_STRING) {
|
||||
if (Z_STRVAL_PP(arg_pattern) && Z_STRLEN_PP(arg_pattern))
|
||||
if (Z_STRVAL_PP(arg_pattern) && Z_STRLEN_PP(arg_pattern)) {
|
||||
pattern = estrndup(Z_STRVAL_PP(arg_pattern), Z_STRLEN_PP(arg_pattern));
|
||||
else
|
||||
} else {
|
||||
pattern = STR_EMPTY_ALLOC();
|
||||
}
|
||||
} else {
|
||||
convert_to_long_ex(arg_pattern);
|
||||
pattern = emalloc(2);
|
||||
@ -548,10 +550,11 @@ static void php_do_ereg_replace(INTERNAL_FUNCTION_PARAMETERS, int icase)
|
||||
}
|
||||
|
||||
if (Z_TYPE_PP(arg_replace) == IS_STRING) {
|
||||
if (Z_STRVAL_PP(arg_replace) && Z_STRLEN_PP(arg_replace))
|
||||
if (Z_STRVAL_PP(arg_replace) && Z_STRLEN_PP(arg_replace)) {
|
||||
replace = estrndup(Z_STRVAL_PP(arg_replace), Z_STRLEN_PP(arg_replace));
|
||||
else
|
||||
} else {
|
||||
replace = STR_EMPTY_ALLOC();
|
||||
}
|
||||
} else {
|
||||
convert_to_long_ex(arg_replace);
|
||||
replace = emalloc(2);
|
||||
@ -559,11 +562,11 @@ static void php_do_ereg_replace(INTERNAL_FUNCTION_PARAMETERS, int icase)
|
||||
replace[1] = '\0';
|
||||
}
|
||||
|
||||
convert_to_string_ex(arg_string);
|
||||
if (Z_STRVAL_PP(arg_string) && Z_STRLEN_PP(arg_string))
|
||||
string = estrndup(Z_STRVAL_PP(arg_string), Z_STRLEN_PP(arg_string));
|
||||
else
|
||||
if (arg_string && arg_string_len) {
|
||||
string = estrndup(arg_string, arg_string_len);
|
||||
} else {
|
||||
string = STR_EMPTY_ALLOC();
|
||||
}
|
||||
|
||||
/* do the actual work */
|
||||
ret = php_ereg_replace(pattern, replace, string, icase, 1);
|
||||
@ -600,33 +603,30 @@ PHP_FUNCTION(eregi_replace)
|
||||
*/
|
||||
static void php_split(INTERNAL_FUNCTION_PARAMETERS, int icase)
|
||||
{
|
||||
zval **spliton, **str, **arg_count = NULL;
|
||||
long arg_count;
|
||||
regex_t re;
|
||||
regmatch_t subs[1];
|
||||
char *strp, *endp;
|
||||
char *spliton, *str, *strp, *endp;
|
||||
int spliton_len, str_len;
|
||||
int err, size, count = -1, copts = 0;
|
||||
int argc = ZEND_NUM_ARGS();
|
||||
|
||||
if (argc < 2 || argc > 3 ||
|
||||
zend_get_parameters_ex(argc, &spliton, &str, &arg_count) == FAILURE) {
|
||||
WRONG_PARAM_COUNT;
|
||||
if (zend_parse_parameters(argc TSRMLS_CC, "ss|l", &spliton, &spliton_len, &str, &str_len, &arg_count) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (argc > 2) {
|
||||
convert_to_long_ex(arg_count);
|
||||
count = Z_LVAL_PP(arg_count);
|
||||
count = arg_count;
|
||||
}
|
||||
|
||||
if (icase)
|
||||
if (icase) {
|
||||
copts = REG_ICASE;
|
||||
}
|
||||
|
||||
convert_to_string_ex(spliton);
|
||||
convert_to_string_ex(str);
|
||||
strp = str;
|
||||
endp = strp + str_len;
|
||||
|
||||
strp = Z_STRVAL_PP(str);
|
||||
endp = strp + Z_STRLEN_PP(str);
|
||||
|
||||
err = regcomp(&re, Z_STRVAL_PP(spliton), REG_EXTENDED | copts);
|
||||
err = regcomp(&re, spliton, REG_EXTENDED | copts);
|
||||
if (err) {
|
||||
php_ereg_eprint(err, &re);
|
||||
RETURN_FALSE;
|
||||
@ -710,21 +710,20 @@ PHP_FUNCTION(spliti)
|
||||
Make regular expression for case insensitive match */
|
||||
PHPAPI PHP_FUNCTION(sql_regcase)
|
||||
{
|
||||
zval **string;
|
||||
char *tmp;
|
||||
char *string, *tmp;
|
||||
int string_len;
|
||||
unsigned char c;
|
||||
register int i, j;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &string, &string_len) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (ZEND_NUM_ARGS()!=1 || zend_get_parameters_ex(1, &string)==FAILURE) {
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
convert_to_string_ex(string);
|
||||
tmp = safe_emalloc(string_len, 4, 1);
|
||||
|
||||
tmp = safe_emalloc(Z_STRLEN_PP(string), 4, 1);
|
||||
|
||||
for (i = j = 0; i < Z_STRLEN_PP(string); i++) {
|
||||
c = (unsigned char) Z_STRVAL_PP(string)[i];
|
||||
if(isalpha(c)) {
|
||||
for (i = j = 0; i < string_len; i++) {
|
||||
c = (unsigned char) string[i];
|
||||
if (isalpha(c)) {
|
||||
tmp[j++] = '[';
|
||||
tmp[j++] = toupper(c);
|
||||
tmp[j++] = tolower(c);
|
||||
|
@ -35,11 +35,11 @@ echo "Done";
|
||||
|
||||
-- Testing ereg() function with more than expected no. of arguments --
|
||||
|
||||
Warning: Wrong parameter count for ereg() in %s on line 21
|
||||
Warning: ereg() expects at most 3 parameters, 4 given in %s on line 21
|
||||
NULL
|
||||
|
||||
-- Testing ereg() function with less than expected no. of arguments --
|
||||
|
||||
Warning: Wrong parameter count for ereg() in %s on line 26
|
||||
Warning: ereg() expects at least 2 parameters, 1 given in %s on line 26
|
||||
NULL
|
||||
Done
|
||||
|
@ -32,11 +32,11 @@ echo "Done";
|
||||
|
||||
-- Testing ereg_replace() function with more than expected no. of arguments --
|
||||
|
||||
Warning: Wrong parameter count for ereg_replace() in %s on line 17
|
||||
Warning: ereg_replace() expects exactly 3 parameters, 4 given in %s on line 17
|
||||
NULL
|
||||
|
||||
-- Testing ereg_replace() function with less than expected no. of arguments --
|
||||
|
||||
Warning: Wrong parameter count for ereg_replace() in %s on line 23
|
||||
Warning: ereg_replace() expects exactly 3 parameters, 2 given in %s on line 23
|
||||
NULL
|
||||
Done
|
||||
Done
|
||||
|
@ -112,24 +112,24 @@ Arg value 0.5
|
||||
string(3) "0.5"
|
||||
|
||||
Arg value Array
|
||||
Error: 8 - Array to string conversion, %s(74)
|
||||
string(5) "Array"
|
||||
Error: 2 - ereg_replace() expects parameter 3 to be string, array given, %s(74)
|
||||
NULL
|
||||
|
||||
Arg value Array
|
||||
Error: 8 - Array to string conversion, %s(74)
|
||||
string(5) "Array"
|
||||
Error: 2 - ereg_replace() expects parameter 3 to be string, array given, %s(74)
|
||||
NULL
|
||||
|
||||
Arg value Array
|
||||
Error: 8 - Array to string conversion, %s(74)
|
||||
string(5) "Array"
|
||||
Error: 2 - ereg_replace() expects parameter 3 to be string, array given, %s(74)
|
||||
NULL
|
||||
|
||||
Arg value Array
|
||||
Error: 8 - Array to string conversion, %s(74)
|
||||
string(5) "Array"
|
||||
Error: 2 - ereg_replace() expects parameter 3 to be string, array given, %s(74)
|
||||
NULL
|
||||
|
||||
Arg value Array
|
||||
Error: 8 - Array to string conversion, %s(74)
|
||||
string(5) "Array"
|
||||
Error: 2 - ereg_replace() expects parameter 3 to be string, array given, %s(74)
|
||||
NULL
|
||||
|
||||
Arg value
|
||||
string(0) ""
|
||||
@ -157,13 +157,12 @@ string(0) ""
|
||||
Error: 4096 - Object of class stdClass could not be converted to string, %s(73)
|
||||
|
||||
Arg value
|
||||
Error: 4096 - Object of class stdClass could not be converted to string, %s(74)
|
||||
Error: 8 - Object of class stdClass to string conversion, %s(74)
|
||||
string(6) "Object"
|
||||
Error: 2 - ereg_replace() expects parameter 3 to be string, object given, %s(74)
|
||||
NULL
|
||||
|
||||
Arg value
|
||||
string(0) ""
|
||||
|
||||
Arg value
|
||||
string(0) ""
|
||||
Done
|
||||
Done
|
||||
|
@ -112,24 +112,24 @@ Arg value 0.5
|
||||
bool(false)
|
||||
|
||||
Arg value Array
|
||||
Error: 8 - Array to string conversion, %s(74)
|
||||
bool(false)
|
||||
Error: 2 - ereg() expects parameter 2 to be string, array given, %s(74)
|
||||
NULL
|
||||
|
||||
Arg value Array
|
||||
Error: 8 - Array to string conversion, %s(74)
|
||||
bool(false)
|
||||
Error: 2 - ereg() expects parameter 2 to be string, array given, %s(74)
|
||||
NULL
|
||||
|
||||
Arg value Array
|
||||
Error: 8 - Array to string conversion, %s(74)
|
||||
bool(false)
|
||||
Error: 2 - ereg() expects parameter 2 to be string, array given, %s(74)
|
||||
NULL
|
||||
|
||||
Arg value Array
|
||||
Error: 8 - Array to string conversion, %s(74)
|
||||
bool(false)
|
||||
Error: 2 - ereg() expects parameter 2 to be string, array given, %s(74)
|
||||
NULL
|
||||
|
||||
Arg value Array
|
||||
Error: 8 - Array to string conversion, %s(74)
|
||||
bool(false)
|
||||
Error: 2 - ereg() expects parameter 2 to be string, array given, %s(74)
|
||||
NULL
|
||||
|
||||
Arg value
|
||||
bool(false)
|
||||
@ -157,13 +157,12 @@ bool(false)
|
||||
Error: 4096 - Object of class stdClass could not be converted to string, %s(73)
|
||||
|
||||
Arg value
|
||||
Error: 4096 - Object of class stdClass could not be converted to string, %s(74)
|
||||
Error: 8 - Object of class stdClass to string conversion, %s(74)
|
||||
bool(false)
|
||||
Error: 2 - ereg() expects parameter 2 to be string, object given, %s(74)
|
||||
NULL
|
||||
|
||||
Arg value
|
||||
bool(false)
|
||||
|
||||
Arg value
|
||||
bool(false)
|
||||
Done
|
||||
Done
|
||||
|
@ -35,11 +35,11 @@ echo "Done";
|
||||
|
||||
-- Testing eregi() function with more than expected no. of arguments --
|
||||
|
||||
Warning: Wrong parameter count for eregi() in %s on line 21
|
||||
Warning: eregi() expects at most 3 parameters, 4 given in %s on line 21
|
||||
NULL
|
||||
|
||||
-- Testing eregi() function with less than expected no. of arguments --
|
||||
|
||||
Warning: Wrong parameter count for eregi() in %s on line 26
|
||||
Warning: eregi() expects at least 2 parameters, 1 given in %s on line 26
|
||||
NULL
|
||||
Done
|
||||
|
@ -32,11 +32,11 @@ echo "Done";
|
||||
|
||||
-- Testing eregi_replace() function with more than expected no. of arguments --
|
||||
|
||||
Warning: Wrong parameter count for eregi_replace() in %s on line 17
|
||||
Warning: eregi_replace() expects exactly 3 parameters, 4 given in %s on line 17
|
||||
NULL
|
||||
|
||||
-- Testing eregi_replace() function with less than expected no. of arguments --
|
||||
|
||||
Warning: Wrong parameter count for eregi_replace() in %s on line 23
|
||||
Warning: eregi_replace() expects exactly 3 parameters, 2 given in %s on line 23
|
||||
NULL
|
||||
Done
|
||||
Done
|
||||
|
@ -112,24 +112,24 @@ Arg value 0.5
|
||||
string(3) "0.5"
|
||||
|
||||
Arg value Array
|
||||
Error: 8 - Array to string conversion, %s(74)
|
||||
string(5) "Array"
|
||||
Error: 2 - eregi_replace() expects parameter 3 to be string, array given, %s(74)
|
||||
NULL
|
||||
|
||||
Arg value Array
|
||||
Error: 8 - Array to string conversion, %s(74)
|
||||
string(5) "Array"
|
||||
Error: 2 - eregi_replace() expects parameter 3 to be string, array given, %s(74)
|
||||
NULL
|
||||
|
||||
Arg value Array
|
||||
Error: 8 - Array to string conversion, %s(74)
|
||||
string(5) "Array"
|
||||
Error: 2 - eregi_replace() expects parameter 3 to be string, array given, %s(74)
|
||||
NULL
|
||||
|
||||
Arg value Array
|
||||
Error: 8 - Array to string conversion, %s(74)
|
||||
string(5) "Array"
|
||||
Error: 2 - eregi_replace() expects parameter 3 to be string, array given, %s(74)
|
||||
NULL
|
||||
|
||||
Arg value Array
|
||||
Error: 8 - Array to string conversion, %s(74)
|
||||
string(5) "Array"
|
||||
Error: 2 - eregi_replace() expects parameter 3 to be string, array given, %s(74)
|
||||
NULL
|
||||
|
||||
Arg value
|
||||
string(0) ""
|
||||
@ -157,13 +157,12 @@ string(0) ""
|
||||
Error: 4096 - Object of class stdClass could not be converted to string, %s(73)
|
||||
|
||||
Arg value
|
||||
Error: 4096 - Object of class stdClass could not be converted to string, %s(74)
|
||||
Error: 8 - Object of class stdClass to string conversion, %s(74)
|
||||
string(6) "Object"
|
||||
Error: 2 - eregi_replace() expects parameter 3 to be string, object given, %s(74)
|
||||
NULL
|
||||
|
||||
Arg value
|
||||
string(0) ""
|
||||
|
||||
Arg value
|
||||
string(0) ""
|
||||
Done
|
||||
Done
|
||||
|
@ -112,24 +112,24 @@ Arg value 0.5
|
||||
bool(false)
|
||||
|
||||
Arg value Array
|
||||
Error: 8 - Array to string conversion, %s(74)
|
||||
bool(false)
|
||||
Error: 2 - eregi() expects parameter 2 to be string, array given, %s(74)
|
||||
NULL
|
||||
|
||||
Arg value Array
|
||||
Error: 8 - Array to string conversion, %s(74)
|
||||
bool(false)
|
||||
Error: 2 - eregi() expects parameter 2 to be string, array given, %s(74)
|
||||
NULL
|
||||
|
||||
Arg value Array
|
||||
Error: 8 - Array to string conversion, %s(74)
|
||||
bool(false)
|
||||
Error: 2 - eregi() expects parameter 2 to be string, array given, %s(74)
|
||||
NULL
|
||||
|
||||
Arg value Array
|
||||
Error: 8 - Array to string conversion, %s(74)
|
||||
bool(false)
|
||||
Error: 2 - eregi() expects parameter 2 to be string, array given, %s(74)
|
||||
NULL
|
||||
|
||||
Arg value Array
|
||||
Error: 8 - Array to string conversion, %s(74)
|
||||
bool(false)
|
||||
Error: 2 - eregi() expects parameter 2 to be string, array given, %s(74)
|
||||
NULL
|
||||
|
||||
Arg value
|
||||
bool(false)
|
||||
@ -157,13 +157,12 @@ bool(false)
|
||||
Error: 4096 - Object of class stdClass could not be converted to string, %s(73)
|
||||
|
||||
Arg value
|
||||
Error: 4096 - Object of class stdClass could not be converted to string, %s(74)
|
||||
Error: 8 - Object of class stdClass to string conversion, %s(74)
|
||||
bool(false)
|
||||
Error: 2 - eregi() expects parameter 2 to be string, object given, %s(74)
|
||||
NULL
|
||||
|
||||
Arg value
|
||||
bool(false)
|
||||
|
||||
Arg value
|
||||
bool(false)
|
||||
Done
|
||||
Done
|
||||
|
@ -31,11 +31,11 @@ echo "Done";
|
||||
|
||||
-- Testing split() function with more than expected no. of arguments --
|
||||
|
||||
Warning: Wrong parameter count for split() in %s on line 17
|
||||
Warning: split() expects at most 3 parameters, 4 given in %s on line 17
|
||||
NULL
|
||||
|
||||
-- Testing split() function with less than expected no. of arguments --
|
||||
|
||||
Warning: Wrong parameter count for split() in %s on line 22
|
||||
Warning: split() expects at least 2 parameters, 1 given in %s on line 22
|
||||
NULL
|
||||
Done
|
||||
Done
|
||||
|
@ -61,8 +61,8 @@ bool(false)
|
||||
Warning: split(): REG_BADRPT in %s on line 22
|
||||
bool(false)
|
||||
|
||||
Warning: split(): REG_BADRPT in %s on line 23
|
||||
bool(false)
|
||||
Warning: split() expects parameter 3 to be long, string given in %s on line 23
|
||||
NULL
|
||||
|
||||
Warning: split(): REG_BADBR in %s on line 24
|
||||
bool(false)
|
||||
@ -82,7 +82,7 @@ bool(false)
|
||||
Warning: split(): REG_EESCAPE in %s on line 29
|
||||
bool(false)
|
||||
|
||||
Warning: split(): REG_ERANGE in %s on line 30
|
||||
bool(false)
|
||||
Warning: split() expects parameter 3 to be long, string given in %s on line 30
|
||||
NULL
|
||||
string(8) "original"
|
||||
Done
|
||||
Done
|
||||
|
@ -145,49 +145,24 @@ array(1) {
|
||||
}
|
||||
|
||||
Arg value Array
|
||||
Error: 8 - Array to string conversion, %s(74)
|
||||
array(2) {
|
||||
[0]=>
|
||||
string(6) "1 a 1 "
|
||||
[1]=>
|
||||
string(5) " 1 c "
|
||||
}
|
||||
Error: 2 - split() expects parameter 1 to be string, array given, %s(74)
|
||||
NULL
|
||||
|
||||
Arg value Array
|
||||
Error: 8 - Array to string conversion, %s(74)
|
||||
array(2) {
|
||||
[0]=>
|
||||
string(6) "1 a 1 "
|
||||
[1]=>
|
||||
string(5) " 1 c "
|
||||
}
|
||||
Error: 2 - split() expects parameter 1 to be string, array given, %s(74)
|
||||
NULL
|
||||
|
||||
Arg value Array
|
||||
Error: 8 - Array to string conversion, %s(74)
|
||||
array(2) {
|
||||
[0]=>
|
||||
string(6) "1 a 1 "
|
||||
[1]=>
|
||||
string(5) " 1 c "
|
||||
}
|
||||
Error: 2 - split() expects parameter 1 to be string, array given, %s(74)
|
||||
NULL
|
||||
|
||||
Arg value Array
|
||||
Error: 8 - Array to string conversion, %s(74)
|
||||
array(2) {
|
||||
[0]=>
|
||||
string(6) "1 a 1 "
|
||||
[1]=>
|
||||
string(5) " 1 c "
|
||||
}
|
||||
Error: 2 - split() expects parameter 1 to be string, array given, %s(74)
|
||||
NULL
|
||||
|
||||
Arg value Array
|
||||
Error: 8 - Array to string conversion, %s(74)
|
||||
array(2) {
|
||||
[0]=>
|
||||
string(6) "1 a 1 "
|
||||
[1]=>
|
||||
string(5) " 1 c "
|
||||
}
|
||||
Error: 2 - split() expects parameter 1 to be string, array given, %s(74)
|
||||
NULL
|
||||
|
||||
Arg value
|
||||
Error: 2 - split(): REG_EMPTY, %s(74)
|
||||
@ -239,12 +214,8 @@ bool(false)
|
||||
Error: 4096 - Object of class stdClass could not be converted to string, %s(73)
|
||||
|
||||
Arg value
|
||||
Error: 4096 - Object of class stdClass could not be converted to string, %s(74)
|
||||
Error: 8 - Object of class stdClass to string conversion, %s(74)
|
||||
array(1) {
|
||||
[0]=>
|
||||
string(16) "1 a 1 Array 1 c "
|
||||
}
|
||||
Error: 2 - split() expects parameter 1 to be string, object given, %s(74)
|
||||
NULL
|
||||
|
||||
Arg value
|
||||
Error: 2 - split(): REG_EMPTY, %s(74)
|
||||
@ -253,4 +224,4 @@ bool(false)
|
||||
Arg value
|
||||
Error: 2 - split(): REG_EMPTY, %s(74)
|
||||
bool(false)
|
||||
Done
|
||||
Done
|
||||
|
@ -141,59 +141,24 @@ array(1) {
|
||||
}
|
||||
|
||||
Arg value Array
|
||||
Error: 8 - Array to string conversion, %s(74)
|
||||
array(3) {
|
||||
[0]=>
|
||||
string(1) "A"
|
||||
[1]=>
|
||||
string(0) ""
|
||||
[2]=>
|
||||
string(2) "ay"
|
||||
}
|
||||
Error: 2 - split() expects parameter 2 to be string, array given, %s(74)
|
||||
NULL
|
||||
|
||||
Arg value Array
|
||||
Error: 8 - Array to string conversion, %s(74)
|
||||
array(3) {
|
||||
[0]=>
|
||||
string(1) "A"
|
||||
[1]=>
|
||||
string(0) ""
|
||||
[2]=>
|
||||
string(2) "ay"
|
||||
}
|
||||
Error: 2 - split() expects parameter 2 to be string, array given, %s(74)
|
||||
NULL
|
||||
|
||||
Arg value Array
|
||||
Error: 8 - Array to string conversion, %s(74)
|
||||
array(3) {
|
||||
[0]=>
|
||||
string(1) "A"
|
||||
[1]=>
|
||||
string(0) ""
|
||||
[2]=>
|
||||
string(2) "ay"
|
||||
}
|
||||
Error: 2 - split() expects parameter 2 to be string, array given, %s(74)
|
||||
NULL
|
||||
|
||||
Arg value Array
|
||||
Error: 8 - Array to string conversion, %s(74)
|
||||
array(3) {
|
||||
[0]=>
|
||||
string(1) "A"
|
||||
[1]=>
|
||||
string(0) ""
|
||||
[2]=>
|
||||
string(2) "ay"
|
||||
}
|
||||
Error: 2 - split() expects parameter 2 to be string, array given, %s(74)
|
||||
NULL
|
||||
|
||||
Arg value Array
|
||||
Error: 8 - Array to string conversion, %s(74)
|
||||
array(3) {
|
||||
[0]=>
|
||||
string(1) "A"
|
||||
[1]=>
|
||||
string(0) ""
|
||||
[2]=>
|
||||
string(2) "ay"
|
||||
}
|
||||
Error: 2 - split() expects parameter 2 to be string, array given, %s(74)
|
||||
NULL
|
||||
|
||||
Arg value
|
||||
array(1) {
|
||||
@ -245,14 +210,8 @@ array(1) {
|
||||
Error: 4096 - Object of class stdClass could not be converted to string, %s(73)
|
||||
|
||||
Arg value
|
||||
Error: 4096 - Object of class stdClass could not be converted to string, %s(74)
|
||||
Error: 8 - Object of class stdClass to string conversion, %s(74)
|
||||
array(2) {
|
||||
[0]=>
|
||||
string(2) "Ob"
|
||||
[1]=>
|
||||
string(3) "ect"
|
||||
}
|
||||
Error: 2 - split() expects parameter 2 to be string, object given, /home/felipe/php5/ext/ereg/tests/split_variation_002.php(74)
|
||||
NULL
|
||||
|
||||
Arg value
|
||||
array(1) {
|
||||
|
@ -114,34 +114,24 @@ array(1) {
|
||||
}
|
||||
|
||||
Arg value Array
|
||||
array(1) {
|
||||
[0]=>
|
||||
string(9) "1 2 3 4 5"
|
||||
}
|
||||
Error: 2 - split() expects parameter 3 to be long, array given, %s(73)
|
||||
NULL
|
||||
|
||||
Arg value Array
|
||||
array(1) {
|
||||
[0]=>
|
||||
string(9) "1 2 3 4 5"
|
||||
}
|
||||
Error: 2 - split() expects parameter 3 to be long, array given, %s(73)
|
||||
NULL
|
||||
|
||||
Arg value Array
|
||||
array(1) {
|
||||
[0]=>
|
||||
string(9) "1 2 3 4 5"
|
||||
}
|
||||
Error: 2 - split() expects parameter 3 to be long, array given, %s(73)
|
||||
NULL
|
||||
|
||||
Arg value Array
|
||||
array(1) {
|
||||
[0]=>
|
||||
string(9) "1 2 3 4 5"
|
||||
}
|
||||
Error: 2 - split() expects parameter 3 to be long, array given, %s(73)
|
||||
NULL
|
||||
|
||||
Arg value Array
|
||||
array(1) {
|
||||
[0]=>
|
||||
string(9) "1 2 3 4 5"
|
||||
}
|
||||
Error: 2 - split() expects parameter 3 to be long, array given, %s(73)
|
||||
NULL
|
||||
|
||||
Arg value
|
||||
array(1) {
|
||||
@ -180,36 +170,25 @@ array(1) {
|
||||
}
|
||||
|
||||
Arg value
|
||||
array(1) {
|
||||
[0]=>
|
||||
string(9) "1 2 3 4 5"
|
||||
}
|
||||
Error: 2 - split() expects parameter 3 to be long, string given, %s(73)
|
||||
NULL
|
||||
|
||||
Arg value
|
||||
array(1) {
|
||||
[0]=>
|
||||
string(9) "1 2 3 4 5"
|
||||
}
|
||||
Error: 2 - split() expects parameter 3 to be long, string given, %s(73)
|
||||
NULL
|
||||
|
||||
Arg value string
|
||||
array(1) {
|
||||
[0]=>
|
||||
string(9) "1 2 3 4 5"
|
||||
}
|
||||
Error: 2 - split() expects parameter 3 to be long, string given, %s(73)
|
||||
NULL
|
||||
|
||||
Arg value string
|
||||
array(1) {
|
||||
[0]=>
|
||||
string(9) "1 2 3 4 5"
|
||||
}
|
||||
Error: 2 - split() expects parameter 3 to be long, string given, %s(73)
|
||||
NULL
|
||||
Error: 4096 - Object of class stdClass could not be converted to string, %s(72)
|
||||
|
||||
Arg value
|
||||
Error: 8 - Object of class stdClass could not be converted to int, %s(73)
|
||||
array(1) {
|
||||
[0]=>
|
||||
string(9) "1 2 3 4 5"
|
||||
}
|
||||
Error: 2 - split() expects parameter 3 to be long, object given, %s(73)
|
||||
NULL
|
||||
|
||||
Arg value
|
||||
array(1) {
|
||||
@ -222,4 +201,4 @@ array(1) {
|
||||
[0]=>
|
||||
string(9) "1 2 3 4 5"
|
||||
}
|
||||
Done
|
||||
Done
|
||||
|
@ -31,11 +31,11 @@ echo "Done";
|
||||
|
||||
-- Testing spliti() function with more than expected no. of arguments --
|
||||
|
||||
Warning: Wrong parameter count for spliti() in %s on line 17
|
||||
Warning: spliti() expects at most 3 parameters, 4 given in %s on line %d
|
||||
NULL
|
||||
|
||||
-- Testing spliti() function with less than expected no. of arguments --
|
||||
|
||||
Warning: Wrong parameter count for spliti() in %s on line 22
|
||||
Warning: spliti() expects at least 2 parameters, 1 given in %s on line %d
|
||||
NULL
|
||||
Done
|
||||
Done
|
||||
|
@ -61,8 +61,8 @@ bool(false)
|
||||
Warning: spliti(): REG_BADRPT in %s on line 22
|
||||
bool(false)
|
||||
|
||||
Warning: spliti(): REG_BADRPT in %s on line 23
|
||||
bool(false)
|
||||
Warning: spliti() expects parameter 3 to be long, string given in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: spliti(): REG_BADBR in %s on line 24
|
||||
bool(false)
|
||||
@ -82,7 +82,7 @@ bool(false)
|
||||
Warning: spliti(): REG_EESCAPE in %s on line 29
|
||||
bool(false)
|
||||
|
||||
Warning: spliti(): REG_ERANGE in %s on line 30
|
||||
bool(false)
|
||||
Warning: spliti() expects parameter 3 to be long, string given in %s on line %d
|
||||
NULL
|
||||
string(8) "original"
|
||||
Done
|
||||
Done
|
||||
|
@ -145,49 +145,24 @@ array(1) {
|
||||
}
|
||||
|
||||
Arg value Array
|
||||
Error: 8 - Array to string conversion, %s(74)
|
||||
array(2) {
|
||||
[0]=>
|
||||
string(6) "1 a 1 "
|
||||
[1]=>
|
||||
string(5) " 1 c "
|
||||
}
|
||||
Error: 2 - spliti() expects parameter 1 to be string, array given, %s(74)
|
||||
NULL
|
||||
|
||||
Arg value Array
|
||||
Error: 8 - Array to string conversion, %s(74)
|
||||
array(2) {
|
||||
[0]=>
|
||||
string(6) "1 a 1 "
|
||||
[1]=>
|
||||
string(5) " 1 c "
|
||||
}
|
||||
Error: 2 - spliti() expects parameter 1 to be string, array given, %s(74)
|
||||
NULL
|
||||
|
||||
Arg value Array
|
||||
Error: 8 - Array to string conversion, %s(74)
|
||||
array(2) {
|
||||
[0]=>
|
||||
string(6) "1 a 1 "
|
||||
[1]=>
|
||||
string(5) " 1 c "
|
||||
}
|
||||
Error: 2 - spliti() expects parameter 1 to be string, array given, %s(74)
|
||||
NULL
|
||||
|
||||
Arg value Array
|
||||
Error: 8 - Array to string conversion, %s(74)
|
||||
array(2) {
|
||||
[0]=>
|
||||
string(6) "1 a 1 "
|
||||
[1]=>
|
||||
string(5) " 1 c "
|
||||
}
|
||||
Error: 2 - spliti() expects parameter 1 to be string, array given, %s(74)
|
||||
NULL
|
||||
|
||||
Arg value Array
|
||||
Error: 8 - Array to string conversion, %s(74)
|
||||
array(2) {
|
||||
[0]=>
|
||||
string(6) "1 a 1 "
|
||||
[1]=>
|
||||
string(5) " 1 c "
|
||||
}
|
||||
Error: 2 - spliti() expects parameter 1 to be string, array given, %s(74)
|
||||
NULL
|
||||
|
||||
Arg value
|
||||
Error: 2 - spliti(): REG_EMPTY, %s(74)
|
||||
@ -239,12 +214,8 @@ bool(false)
|
||||
Error: 4096 - Object of class stdClass could not be converted to string, %s(73)
|
||||
|
||||
Arg value
|
||||
Error: 4096 - Object of class stdClass could not be converted to string, %s(74)
|
||||
Error: 8 - Object of class stdClass to string conversion, %s(74)
|
||||
array(1) {
|
||||
[0]=>
|
||||
string(16) "1 a 1 Array 1 c "
|
||||
}
|
||||
Error: 2 - spliti() expects parameter 1 to be string, object given, %s(74)
|
||||
NULL
|
||||
|
||||
Arg value
|
||||
Error: 2 - spliti(): REG_EMPTY, %s(74)
|
||||
@ -253,4 +224,4 @@ bool(false)
|
||||
Arg value
|
||||
Error: 2 - spliti(): REG_EMPTY, %s(74)
|
||||
bool(false)
|
||||
Done
|
||||
Done
|
||||
|
@ -141,59 +141,24 @@ array(1) {
|
||||
}
|
||||
|
||||
Arg value Array
|
||||
Error: 8 - Array to string conversion, %s(74)
|
||||
array(3) {
|
||||
[0]=>
|
||||
string(1) "A"
|
||||
[1]=>
|
||||
string(0) ""
|
||||
[2]=>
|
||||
string(2) "ay"
|
||||
}
|
||||
Error: 2 - spliti() expects parameter 2 to be string, array given, %s(74)
|
||||
NULL
|
||||
|
||||
Arg value Array
|
||||
Error: 8 - Array to string conversion, %s(74)
|
||||
array(3) {
|
||||
[0]=>
|
||||
string(1) "A"
|
||||
[1]=>
|
||||
string(0) ""
|
||||
[2]=>
|
||||
string(2) "ay"
|
||||
}
|
||||
Error: 2 - spliti() expects parameter 2 to be string, array given, %s(74)
|
||||
NULL
|
||||
|
||||
Arg value Array
|
||||
Error: 8 - Array to string conversion, %s(74)
|
||||
array(3) {
|
||||
[0]=>
|
||||
string(1) "A"
|
||||
[1]=>
|
||||
string(0) ""
|
||||
[2]=>
|
||||
string(2) "ay"
|
||||
}
|
||||
Error: 2 - spliti() expects parameter 2 to be string, array given, %s(74)
|
||||
NULL
|
||||
|
||||
Arg value Array
|
||||
Error: 8 - Array to string conversion, %s(74)
|
||||
array(3) {
|
||||
[0]=>
|
||||
string(1) "A"
|
||||
[1]=>
|
||||
string(0) ""
|
||||
[2]=>
|
||||
string(2) "ay"
|
||||
}
|
||||
Error: 2 - spliti() expects parameter 2 to be string, array given, %s(74)
|
||||
NULL
|
||||
|
||||
Arg value Array
|
||||
Error: 8 - Array to string conversion, %s(74)
|
||||
array(3) {
|
||||
[0]=>
|
||||
string(1) "A"
|
||||
[1]=>
|
||||
string(0) ""
|
||||
[2]=>
|
||||
string(2) "ay"
|
||||
}
|
||||
Error: 2 - spliti() expects parameter 2 to be string, array given, %s(74)
|
||||
NULL
|
||||
|
||||
Arg value
|
||||
array(1) {
|
||||
@ -245,16 +210,8 @@ array(1) {
|
||||
Error: 4096 - Object of class stdClass could not be converted to string, %s(73)
|
||||
|
||||
Arg value
|
||||
Error: 4096 - Object of class stdClass could not be converted to string, %s(74)
|
||||
Error: 8 - Object of class stdClass to string conversion, %s(74)
|
||||
array(3) {
|
||||
[0]=>
|
||||
string(2) "Ob"
|
||||
[1]=>
|
||||
string(0) ""
|
||||
[2]=>
|
||||
string(2) "ct"
|
||||
}
|
||||
Error: 2 - spliti() expects parameter 2 to be string, object given, %s(74)
|
||||
NULL
|
||||
|
||||
Arg value
|
||||
array(1) {
|
||||
|
@ -114,34 +114,24 @@ array(1) {
|
||||
}
|
||||
|
||||
Arg value Array
|
||||
array(1) {
|
||||
[0]=>
|
||||
string(9) "1 2 3 4 5"
|
||||
}
|
||||
Error: 2 - spliti() expects parameter 3 to be long, array given, %s.php(73)
|
||||
NULL
|
||||
|
||||
Arg value Array
|
||||
array(1) {
|
||||
[0]=>
|
||||
string(9) "1 2 3 4 5"
|
||||
}
|
||||
Error: 2 - spliti() expects parameter 3 to be long, array given, %s.php(73)
|
||||
NULL
|
||||
|
||||
Arg value Array
|
||||
array(1) {
|
||||
[0]=>
|
||||
string(9) "1 2 3 4 5"
|
||||
}
|
||||
Error: 2 - spliti() expects parameter 3 to be long, array given, %s.php(73)
|
||||
NULL
|
||||
|
||||
Arg value Array
|
||||
array(1) {
|
||||
[0]=>
|
||||
string(9) "1 2 3 4 5"
|
||||
}
|
||||
Error: 2 - spliti() expects parameter 3 to be long, array given, %s.php(73)
|
||||
NULL
|
||||
|
||||
Arg value Array
|
||||
array(1) {
|
||||
[0]=>
|
||||
string(9) "1 2 3 4 5"
|
||||
}
|
||||
Error: 2 - spliti() expects parameter 3 to be long, array given, %s.php(73)
|
||||
NULL
|
||||
|
||||
Arg value
|
||||
array(1) {
|
||||
@ -180,36 +170,25 @@ array(1) {
|
||||
}
|
||||
|
||||
Arg value
|
||||
array(1) {
|
||||
[0]=>
|
||||
string(9) "1 2 3 4 5"
|
||||
}
|
||||
Error: 2 - spliti() expects parameter 3 to be long, string given, %s(73)
|
||||
NULL
|
||||
|
||||
Arg value
|
||||
array(1) {
|
||||
[0]=>
|
||||
string(9) "1 2 3 4 5"
|
||||
}
|
||||
Error: 2 - spliti() expects parameter 3 to be long, string given, %s(73)
|
||||
NULL
|
||||
|
||||
Arg value string
|
||||
array(1) {
|
||||
[0]=>
|
||||
string(9) "1 2 3 4 5"
|
||||
}
|
||||
Error: 2 - spliti() expects parameter 3 to be long, string given, %s(73)
|
||||
NULL
|
||||
|
||||
Arg value string
|
||||
array(1) {
|
||||
[0]=>
|
||||
string(9) "1 2 3 4 5"
|
||||
}
|
||||
Error: 2 - spliti() expects parameter 3 to be long, string given, %s(73)
|
||||
NULL
|
||||
Error: 4096 - Object of class stdClass could not be converted to string, %s(72)
|
||||
|
||||
Arg value
|
||||
Error: 8 - Object of class stdClass could not be converted to int, %s(73)
|
||||
array(1) {
|
||||
[0]=>
|
||||
string(9) "1 2 3 4 5"
|
||||
}
|
||||
Error: 2 - spliti() expects parameter 3 to be long, object given, %s(73)
|
||||
NULL
|
||||
|
||||
Arg value
|
||||
array(1) {
|
||||
@ -222,4 +201,4 @@ array(1) {
|
||||
[0]=>
|
||||
string(9) "1 2 3 4 5"
|
||||
}
|
||||
Done
|
||||
Done
|
||||
|
@ -27,11 +27,11 @@ echo "Done";
|
||||
|
||||
-- Testing sql_regcase() function with Zero arguments --
|
||||
|
||||
Warning: Wrong parameter count for sql_regcase() in %s on line 12
|
||||
Warning: sql_regcase() expects exactly 1 parameter, 0 given in %s.php on line 12
|
||||
NULL
|
||||
|
||||
-- Testing sql_regcase() function with more than expected no. of arguments --
|
||||
|
||||
Warning: Wrong parameter count for sql_regcase() in %s on line 18
|
||||
Warning: sql_regcase() expects exactly 1 parameter, 2 given in %s.php on line 18
|
||||
NULL
|
||||
Done
|
||||
Done
|
||||
|
@ -110,24 +110,24 @@ Arg value 0.5
|
||||
string(3) "0.5"
|
||||
|
||||
Arg value Array
|
||||
Error: 8 - Array to string conversion, %s(72)
|
||||
string(20) "[Aa][Rr][Rr][Aa][Yy]"
|
||||
Error: 2 - sql_regcase() expects parameter 1 to be string, array given, %s.php(72)
|
||||
NULL
|
||||
|
||||
Arg value Array
|
||||
Error: 8 - Array to string conversion, %s(72)
|
||||
string(20) "[Aa][Rr][Rr][Aa][Yy]"
|
||||
Error: 2 - sql_regcase() expects parameter 1 to be string, array given, %s.php(72)
|
||||
NULL
|
||||
|
||||
Arg value Array
|
||||
Error: 8 - Array to string conversion, %s(72)
|
||||
string(20) "[Aa][Rr][Rr][Aa][Yy]"
|
||||
Error: 2 - sql_regcase() expects parameter 1 to be string, array given, %s.php(72)
|
||||
NULL
|
||||
|
||||
Arg value Array
|
||||
Error: 8 - Array to string conversion, %s(72)
|
||||
string(20) "[Aa][Rr][Rr][Aa][Yy]"
|
||||
Error: 2 - sql_regcase() expects parameter 1 to be string, array given, %s.php(72)
|
||||
NULL
|
||||
|
||||
Arg value Array
|
||||
Error: 8 - Array to string conversion, %s(72)
|
||||
string(20) "[Aa][Rr][Rr][Aa][Yy]"
|
||||
Error: 2 - sql_regcase() expects parameter 1 to be string, array given, %s.php(72)
|
||||
NULL
|
||||
|
||||
Arg value
|
||||
string(0) ""
|
||||
@ -155,13 +155,12 @@ string(0) ""
|
||||
Error: 4096 - Object of class stdClass could not be converted to string, %s(71)
|
||||
|
||||
Arg value
|
||||
Error: 4096 - Object of class stdClass could not be converted to string, %s(72)
|
||||
Error: 8 - Object of class stdClass to string conversion, %s(72)
|
||||
string(24) "[Oo][Bb][Jj][Ee][Cc][Tt]"
|
||||
Error: 2 - sql_regcase() expects parameter 1 to be string, object given, %s.php(72)
|
||||
NULL
|
||||
|
||||
Arg value
|
||||
string(0) ""
|
||||
|
||||
Arg value
|
||||
string(0) ""
|
||||
Done
|
||||
Done
|
||||
|
Loading…
Reference in New Issue
Block a user