]> granicus.if.org Git - php/commitdiff
- New parameter parsing API
authorFelipe Pena <felipe@php.net>
Sat, 21 Jun 2008 18:16:02 +0000 (18:16 +0000)
committerFelipe Pena <felipe@php.net>
Sat, 21 Jun 2008 18:16:02 +0000 (18:16 +0000)
21 files changed:
ext/ereg/ereg.c
ext/ereg/tests/ereg_error_001.phpt
ext/ereg/tests/ereg_replace_error_001.phpt
ext/ereg/tests/ereg_replace_variation_003.phpt
ext/ereg/tests/ereg_variation_002.phpt
ext/ereg/tests/eregi_error_001.phpt
ext/ereg/tests/eregi_replace_error_001.phpt
ext/ereg/tests/eregi_replace_variation_003.phpt
ext/ereg/tests/eregi_variation_002.phpt
ext/ereg/tests/split_error_001.phpt
ext/ereg/tests/split_error_002.phpt
ext/ereg/tests/split_variation_001.phpt
ext/ereg/tests/split_variation_002.phpt
ext/ereg/tests/split_variation_003.phpt
ext/ereg/tests/spliti_error_001.phpt
ext/ereg/tests/spliti_error_002.phpt
ext/ereg/tests/spliti_variation_001.phpt
ext/ereg/tests/spliti_variation_002.phpt
ext/ereg/tests/spliti_variation_003.phpt
ext/ereg/tests/sql_regcase_error_001.phpt
ext/ereg/tests/sql_regcase_variation_001.phpt

index cefc0d0f3a13c8f4937f11bcb7e7308daeb1e4c3..ed2d71668919623d674f5117c3148fe87557ae62 100644 (file)
@@ -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, &regex, &findin, &array) == FAILURE) {
-               WRONG_PARAM_COUNT;
+
+       if (zend_parse_parameters(argc TSRMLS_CC, "Zs|Z", &regex, &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 = Z_STRVAL_PP(str);
-       endp = strp + Z_STRLEN_PP(str);
+       strp = str;
+       endp = strp + str_len;
 
-       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(Z_STRLEN_PP(string), 4, 1);
+       tmp = safe_emalloc(string_len, 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);
index 44bb1f96538866a98544e7baef7f86232d7a9230..6232326317a737a8a34ebdeaba39dd167c71f27a 100644 (file)
@@ -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
index e6aedf47e2a850e8e44ce73698620680b459042f..8bcc4bfb07b86f4423094efbe44a699bb88e4768 100644 (file)
@@ -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
\ No newline at end of file
+Done
index 1d835359960b0940e3abd2ca82978b997714b545..2d86c0db8975efc9b4aba4fa93f9dc2eacfaea47 100644 (file)
@@ -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
\ No newline at end of file
+Done
index c5f4e8e0168af05843ccc446477a6b44f5c924c4..6cd63c19cb4904b84cc1de17565cf98e94d8af09 100644 (file)
@@ -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
\ No newline at end of file
+Done
index a767e24b5903fbe70dd1cf49668ff6fef5a8c275..0809d8b67e4c83ac296ab1730f298e6ae67cffbf 100644 (file)
@@ -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
index 8b7f90d9ad44600812262ac2a269ee907c334db0..d4983abe4a918cda2922f5b2aa3163d0c8cd0e60 100644 (file)
@@ -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
\ No newline at end of file
+Done
index f4426fd3cd26ff3a50b7706b0a076921f36496a7..61d468454bc1722c847138c8871507d12f372e81 100644 (file)
@@ -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
\ No newline at end of file
+Done
index 766a48abd3c8c6e5fa58f69ca0da1fc0490ae425..7ca31cf21a47cead567818b30fcf302a6a78be06 100644 (file)
@@ -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
\ No newline at end of file
+Done
index ff8e6cbdd1993b465af1d6640560647e073d4879..cc226df6cb736460121843b3b21b1d44d85daa9d 100644 (file)
@@ -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
\ No newline at end of file
+Done
index 8c4ce345d149be756176d06d91124830f1558279..c0a4529cd7b35967cc8bcbeae36c2edb6ec6f37c 100644 (file)
@@ -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
\ No newline at end of file
+Done
index 625bf062534fa5ab8cd8c89716abfa0a3e9ff349..542f740b1d91622ffec5a4cfd44df770d9c12692 100644 (file)
@@ -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
\ No newline at end of file
+Done
index d7fa8445b342da936a53dee30c6b0d39c676fb9c..b496e1f18e48f8c51ef36aa6ac8db2e0219de0f6 100644 (file)
@@ -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) {
index 9f13c66fd6d323ae20f1a65df8157c795576a7c7..630d8ab2a2d6b43e01126c09234c273141713e3e 100644 (file)
@@ -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
\ No newline at end of file
+Done
index 44d2be6185c32cf87cd80a2c1f0dce3f348ea863..104364eec5d58d307d57b7edadfdcb1a6255c35c 100644 (file)
@@ -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
\ No newline at end of file
+Done
index 030fb2b243ac3f9ce6e75aeb66b3636e04aac365..7a7045dc1efd6925cd2df420cc9bd9541499664b 100644 (file)
@@ -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
\ No newline at end of file
+Done
index b9b15b589568554e0ba8371d7d03b8495883eee8..4facee826ff38cc608547d78895923661293cf50 100644 (file)
@@ -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
\ No newline at end of file
+Done
index a1e51bdb61213e19247b4fa40effa808b71e61d0..b59ef6d81e33ee67f40e7a12bdb200b850f683a1 100644 (file)
@@ -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) {
index 3566a92be060ebd7a65d321d8641208795da8944..7e3f0071c4b19507f41f8a736f5c6a1f1204e4cb 100644 (file)
@@ -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
\ No newline at end of file
+Done
index 3ab9fd8db8123c94b86e929c07c4571d9bf37820..9fb1506004fdfa3d7f897b02f4cf5392f103aa5d 100644 (file)
@@ -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
\ No newline at end of file
+Done
index ed0bef06da3d9d4aeee360dc397d13f070341dee..2445d6dcab06d3254232a7fcf150016800f160a7 100644 (file)
@@ -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
\ No newline at end of file
+Done