ohill Sun Jun 22 19:22:41 2008 UTC Modified files: (Branch: PHP_5_3) /php-src/ext/standard string.c /php-src/ext/standard/tests/strings chop_error.phpt chop_variation1.phpt chop_variation2.phpt chunk_split_variation1.phpt dirname_error.phpt explode1.phpt implode1.phpt join_error.phpt ltrim.phpt rtrim.phpt strpos.phpt strrchr_error.phpt strrchr_variation11.phpt strrchr_variation9.phpt trim1.phpt Log: New parameter parsing API for string, part I
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/string.c?r1=1.445.2.14.2.69.2.22&r2=1.445.2.14.2.69.2.23&diff_format=u Index: php-src/ext/standard/string.c diff -u php-src/ext/standard/string.c:1.445.2.14.2.69.2.22 php-src/ext/standard/string.c:1.445.2.14.2.69.2.23 --- php-src/ext/standard/string.c:1.445.2.14.2.69.2.22 Tue May 27 10:29:33 2008 +++ php-src/ext/standard/string.c Sun Jun 22 19:22:41 2008 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: string.c,v 1.445.2.14.2.69.2.22 2008/05/27 10:29:33 mattwil Exp $ */ +/* $Id: string.c,v 1.445.2.14.2.69.2.23 2008/06/22 19:22:41 ohill Exp $ */ /* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */ @@ -182,16 +182,14 @@ Converts the binary representation of data to hex */ PHP_FUNCTION(bin2hex) { - zval **data; - char *result; - size_t newlen; + char *result, *data; + size_t newlen, datalen; - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &data) == FAILURE) { - WRONG_PARAM_COUNT; + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &data, &datalen) == FAILURE) { + return; } - convert_to_string_ex(data); - result = php_bin2hex(Z_STRVAL_PP(data), Z_STRLEN_PP(data), &newlen); + result = php_bin2hex(data, datalen, &newlen); if (!result) { RETURN_FALSE; @@ -637,16 +635,15 @@ Compares two strings using the current locale */ PHP_FUNCTION(strcoll) { - zval **s1, **s2; - - if (ZEND_NUM_ARGS()!=2 || zend_get_parameters_ex(2, &s1, &s2) == FAILURE) { - WRONG_PARAM_COUNT; + char *s1, *s2; + int s1len, s2len; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &s1, &s1len, &s2, &s2len) == FAILURE) { + return; } - convert_to_string_ex(s1); - convert_to_string_ex(s2); - RETURN_LONG(strcoll((const char *) Z_STRVAL_PP(s1), - (const char *) Z_STRVAL_PP(s2))); + RETURN_LONG(strcoll((const char *) s1, + (const char *) s2)); } /* }}} */ #endif @@ -752,22 +749,15 @@ */ static void php_do_trim(INTERNAL_FUNCTION_PARAMETERS, int mode) { - zval **str; - zval **what = NULL; - int argc = ZEND_NUM_ARGS(); - - if (argc < 1 || argc > 2 || zend_get_parameters_ex(argc, &str, &what) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_string_ex(str); - - if (argc > 1) { - convert_to_string_ex(what); - php_trim(Z_STRVAL_PP(str), Z_STRLEN_PP(str), Z_STRVAL_PP(what), Z_STRLEN_PP(what), return_value, mode TSRMLS_CC); - } else { - php_trim(Z_STRVAL_PP(str), Z_STRLEN_PP(str), NULL, 0, return_value, mode TSRMLS_CC); + char *str; + char *what = NULL; + int str_len, what_len = 0; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s", &str, &str_len, &what, &what_len) == FAILURE) { + return; } + + php_trim(str, str_len, what, what_len, return_value, mode TSRMLS_CC); } /* }}} */ @@ -1010,18 +1000,14 @@ zval **str, **delim, **zlimit = NULL; int limit = -1; int argc = ZEND_NUM_ARGS(); - - if (argc < 2 || argc > 3 || zend_get_parameters_ex(argc, &delim, &str, &zlimit) == FAILURE) { - WRONG_PARAM_COUNT; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ZZ|l", &delim, &str, &limit) == FAILURE) { + return; } + convert_to_string_ex(str); convert_to_string_ex(delim); - if (argc > 2) { - convert_to_long_ex(zlimit); - limit = Z_LVAL_PP(zlimit); - } - if (! Z_STRLEN_PP(delim)) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty delimiter"); RETURN_FALSE; @@ -1140,15 +1126,13 @@ PHP_FUNCTION(implode) { zval **arg1 = NULL, **arg2 = NULL, *delim, *arr; - int argc = ZEND_NUM_ARGS(); HashPosition pos; - if (argc < 1 || argc > 2 || - zend_get_parameters_ex(argc, &arg1, &arg2) == FAILURE) { - WRONG_PARAM_COUNT; + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Z|Z", &arg1, &arg2) == FAILURE) { + return; } - - if (argc == 1) { + + if (arg2 == NULL) { if (Z_TYPE_PP(arg1) != IS_ARRAY) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Argument must be an array"); return; @@ -1181,7 +1165,7 @@ Z_ARRVAL_P(arr)->pInternalPointer = pos; - if (argc == 1) { + if (arg2 == NULL) { FREE_ZVAL(delim); } } @@ -1300,15 +1284,16 @@ Makes a string uppercase */ PHP_FUNCTION(strtoupper) { - zval **arg; + char *arg; + int arglen; - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg)) { - WRONG_PARAM_COUNT; + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &arg, &arglen) == FAILURE) { + return; } - convert_to_string_ex(arg); - RETVAL_ZVAL(*arg, 1, 0); - php_strtoupper(Z_STRVAL_P(return_value), Z_STRLEN_P(return_value)); + php_strtoupper(arg, arglen); + + RETURN_STRINGL(arg, arglen, 1); } /* }}} */ @@ -1333,16 +1318,15 @@ Makes a string lowercase */ PHP_FUNCTION(strtolower) { - zval **str; - char *ret; + char *str; + int arglen; - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &str)) { - WRONG_PARAM_COUNT; + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &str, &arglen) == FAILURE) { + return; } - convert_to_string_ex(str); - RETVAL_ZVAL(*str, 1, 0); - ret = php_strtolower(Z_STRVAL_P(return_value), Z_STRLEN_P(return_value)); + php_strtolower(str, arglen); + RETURN_STRINGL(str, arglen, 1); } /* }}} */ @@ -1448,17 +1432,17 @@ Returns the directory name component of the path */ PHP_FUNCTION(dirname) { - zval **str; + char *str; char *ret; + int str_len; size_t ret_len; - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &str) == FAILURE) { - WRONG_PARAM_COUNT; + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &str, &str_len) == FAILURE) { + return; } - convert_to_string_ex(str); - - ret = estrndup(Z_STRVAL_PP(str), Z_STRLEN_PP(str)); - ret_len = php_dirname(ret, Z_STRLEN_PP(str)); + + ret = estrndup(str, str_len); + ret_len = php_dirname(ret, str_len); RETURN_STRINGL(ret, ret_len, 0); } @@ -1701,23 +1685,18 @@ Finds position of first occurrence of a string within another */ PHP_FUNCTION(strpos) { - zval **haystack, **needle, **z_offset; + zval **needle; + char *haystack; char *found = NULL; char needle_char[2]; int offset = 0; - int argc = ZEND_NUM_ARGS(); - - if (argc < 2 || argc > 3 || zend_get_parameters_ex(argc, &haystack, &needle, &z_offset) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_string_ex(haystack); - - if (argc > 2) { - convert_to_long_ex(z_offset); - offset = Z_LVAL_PP(z_offset); + int haystack_len; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sZ|l", &haystack, &haystack_len, &needle, &offset) == FAILURE) { + return; } - if (offset < 0 || offset > Z_STRLEN_PP(haystack)) { + if (offset < 0 || offset > haystack_len) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset not contained in string"); RETURN_FALSE; } @@ -1728,23 +1707,23 @@ RETURN_FALSE; } - found = php_memnstr(Z_STRVAL_PP(haystack) + offset, + found = php_memnstr(haystack + offset, Z_STRVAL_PP(needle), Z_STRLEN_PP(needle), - Z_STRVAL_PP(haystack) + Z_STRLEN_PP(haystack)); + haystack + haystack_len); } else { convert_to_long_ex(needle); needle_char[0] = (char) Z_LVAL_PP(needle); needle_char[1] = 0; - found = php_memnstr(Z_STRVAL_PP(haystack) + offset, + found = php_memnstr(haystack + offset, needle_char, 1, - Z_STRVAL_PP(haystack) + Z_STRLEN_PP(haystack)); + haystack + haystack_len); } if (found) { - RETURN_LONG(found - Z_STRVAL_PP(haystack)); + RETURN_LONG(found - haystack); } else { RETURN_FALSE; } @@ -2003,26 +1982,26 @@ Finds the last occurrence of a character in a string within another */ PHP_FUNCTION(strrchr) { - zval **haystack, **needle; + zval **needle; + char *haystack; char *found = NULL; long found_offset; + int haystack_len; - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &haystack, &needle) == - FAILURE) { - WRONG_PARAM_COUNT; + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sZ", &haystack, &haystack_len, &needle) == FAILURE) { + return; } - convert_to_string_ex(haystack); if (Z_TYPE_PP(needle) == IS_STRING) { - found = zend_memrchr(Z_STRVAL_PP(haystack), *Z_STRVAL_PP(needle), Z_STRLEN_PP(haystack)); + found = zend_memrchr(haystack, *Z_STRVAL_PP(needle), haystack_len); } else { convert_to_long_ex(needle); - found = zend_memrchr(Z_STRVAL_PP(haystack), (char) Z_LVAL_PP(needle), Z_STRLEN_PP(haystack)); + found = zend_memrchr(haystack, (char) Z_LVAL_PP(needle), haystack_len); } if (found) { - found_offset = found - Z_STRVAL_PP(haystack); - RETURN_STRINGL(found, Z_STRLEN_PP(haystack) - found_offset, 1); + found_offset = found - haystack; + RETURN_STRINGL(found, haystack_len - found_offset, 1); } else { RETURN_FALSE; } @@ -2085,20 +2064,20 @@ Returns split line */ PHP_FUNCTION(chunk_split) { - zval **p_str, **p_chunklen, **p_ending; + zval **p_chunklen, **p_ending; + char *str; char *result; char *end = "\r\n"; int endlen = 2; long chunklen = 76; int result_len; int argc = ZEND_NUM_ARGS(); - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Z|ZZ", &p_str, &p_chunklen, &p_ending) == FAILURE) { + int str_len; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|ZZ", &str, &str_len, &p_chunklen, &p_ending) == FAILURE) { return; } - convert_to_string_ex(p_str); - if (argc > 1) { convert_to_long_ex(p_chunklen); chunklen = Z_LVAL_PP(p_chunklen); @@ -2115,21 +2094,21 @@ RETURN_FALSE; } - if (chunklen > Z_STRLEN_PP(p_str)) { + if (chunklen > str_len) { /* to maintain BC, we must return original string + ending */ - result_len = endlen + Z_STRLEN_PP(p_str); + result_len = endlen + str_len; result = emalloc(result_len + 1); - memcpy(result, Z_STRVAL_PP(p_str), Z_STRLEN_PP(p_str)); - memcpy(result + Z_STRLEN_PP(p_str), end, endlen); + memcpy(result, str, str_len); + memcpy(result + str_len, end, endlen); result[result_len] = '\0'; RETURN_STRINGL(result, result_len, 0); } - if (!Z_STRLEN_PP(p_str)) { + if (!str_len) { RETURN_EMPTY_STRING(); } - result = php_chunk_split(Z_STRVAL_PP(p_str), Z_STRLEN_PP(p_str), end, endlen, chunklen, &result_len); + result = php_chunk_split(str, str_len, end, endlen, chunklen, &result_len); if (result) { RETURN_STRINGL(result, result_len, 0); http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/chop_error.phpt?r1=1.1.2.1&r2=1.1.2.1.2.1&diff_format=u Index: php-src/ext/standard/tests/strings/chop_error.phpt diff -u php-src/ext/standard/tests/strings/chop_error.phpt:1.1.2.1 php-src/ext/standard/tests/strings/chop_error.phpt:1.1.2.1.2.1 --- php-src/ext/standard/tests/strings/chop_error.phpt:1.1.2.1 Fri Sep 14 18:58:02 2007 +++ php-src/ext/standard/tests/strings/chop_error.phpt Sun Jun 22 19:22:41 2008 @@ -33,12 +33,12 @@ -- Testing chop() function with Zero arguments -- -Warning: Wrong parameter count for chop() in %s on line %d +Warning: chop() expects at least 1 parameter, 0 given in %s on line %d NULL -- Testing chop() function with more than expected no. of arguments -- -Warning: Wrong parameter count for chop() in %s on line %d +Warning: chop() expects at most 2 parameters, 3 given in %s on line %d NULL string(11) "string_val " Done http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/chop_variation1.phpt?r1=1.1.2.1.2.3&r2=1.1.2.1.2.4&diff_format=u Index: php-src/ext/standard/tests/strings/chop_variation1.phpt diff -u php-src/ext/standard/tests/strings/chop_variation1.phpt:1.1.2.1.2.3 php-src/ext/standard/tests/strings/chop_variation1.phpt:1.1.2.1.2.4 --- php-src/ext/standard/tests/strings/chop_variation1.phpt:1.1.2.1.2.3 Sat May 24 15:22:20 2008 +++ php-src/ext/standard/tests/strings/chop_variation1.phpt Sun Jun 22 19:22:41 2008 @@ -138,39 +138,39 @@ string(2) "0." -- Iteration 10 -- -Notice: Array to string conversion in %s on line %d -string(5) "Array" +Warning: chop() expects parameter 1 to be string, array given in %s on line %d +NULL -Notice: Array to string conversion in %s on line %d -string(5) "Array" +Warning: chop() expects parameter 1 to be string, array given in %s on line %d +NULL -- Iteration 11 -- -Notice: Array to string conversion in %s on line %d -string(5) "Array" +Warning: chop() expects parameter 1 to be string, array given in %s on line %d +NULL -Notice: Array to string conversion in %s on line %d -string(5) "Array" +Warning: chop() expects parameter 1 to be string, array given in %s on line %d +NULL -- Iteration 12 -- -Notice: Array to string conversion in %s on line %d -string(5) "Array" +Warning: chop() expects parameter 1 to be string, array given in %s on line %d +NULL -Notice: Array to string conversion in %s on line %d -string(5) "Array" +Warning: chop() expects parameter 1 to be string, array given in %s on line %d +NULL -- Iteration 13 -- -Notice: Array to string conversion in %s on line %d -string(5) "Array" +Warning: chop() expects parameter 1 to be string, array given in %s on line %d +NULL -Notice: Array to string conversion in %s on line %d -string(5) "Array" +Warning: chop() expects parameter 1 to be string, array given in %s on line %d +NULL -- Iteration 14 -- -Notice: Array to string conversion in %s on line %d -string(5) "Array" +Warning: chop() expects parameter 1 to be string, array given in %s on line %d +NULL -Notice: Array to string conversion in %s on line %d -string(5) "Array" +Warning: chop() expects parameter 1 to be string, array given in %s on line %d +NULL -- Iteration 15 -- string(1) "1" string(0) "" @@ -205,6 +205,10 @@ string(16) " @#$%Object @#$%" string(11) " @#$%Object" -- Iteration 26 -- -string(%d) "Resource id #%d" -string(11) "Resource id" + +Warning: chop() expects parameter 1 to be string, resource given in %s on line %d +NULL + +Warning: chop() expects parameter 1 to be string, resource given in %s on line %d +NULL Done http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/chop_variation2.phpt?r1=1.1.2.1.2.2&r2=1.1.2.1.2.3&diff_format=u Index: php-src/ext/standard/tests/strings/chop_variation2.phpt diff -u php-src/ext/standard/tests/strings/chop_variation2.phpt:1.1.2.1.2.2 php-src/ext/standard/tests/strings/chop_variation2.phpt:1.1.2.1.2.3 --- php-src/ext/standard/tests/strings/chop_variation2.phpt:1.1.2.1.2.2 Sat May 24 15:22:20 2008 +++ php-src/ext/standard/tests/strings/chop_variation2.phpt Sun Jun 22 19:22:41 2008 @@ -128,24 +128,24 @@ string(17) "hello world12345 " -- Iteration 10 -- -Notice: Array to string conversion in %s on line %d -string(17) "hello world12345 " +Warning: chop() expects parameter 2 to be string, array given in %s on line %d +NULL -- Iteration 11 -- -Notice: Array to string conversion in %s on line %d -string(17) "hello world12345 " +Warning: chop() expects parameter 2 to be string, array given in %s on line %d +NULL -- Iteration 12 -- -Notice: Array to string conversion in %s on line %d -string(17) "hello world12345 " +Warning: chop() expects parameter 2 to be string, array given in %s on line %d +NULL -- Iteration 13 -- -Notice: Array to string conversion in %s on line %d -string(17) "hello world12345 " +Warning: chop() expects parameter 2 to be string, array given in %s on line %d +NULL -- Iteration 14 -- -Notice: Array to string conversion in %s on line %d -string(17) "hello world12345 " +Warning: chop() expects parameter 2 to be string, array given in %s on line %d +NULL -- Iteration 15 -- string(17) "hello world12345 " -- Iteration 16 -- @@ -165,7 +165,9 @@ -- Iteration 23 -- string(17) "hello world12345 " -- Iteration 24 -- -string(%d) "%s" + +Warning: chop() expects parameter 2 to be string, resource given in %s on line %d +NULL -- Iteration 25 -- string(17) "hello world12345 " -- Iteration 26 -- http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/chunk_split_variation1.phpt?r1=1.2.2.6&r2=1.2.2.7&diff_format=u Index: php-src/ext/standard/tests/strings/chunk_split_variation1.phpt diff -u php-src/ext/standard/tests/strings/chunk_split_variation1.phpt:1.2.2.6 php-src/ext/standard/tests/strings/chunk_split_variation1.phpt:1.2.2.7 --- php-src/ext/standard/tests/strings/chunk_split_variation1.phpt:1.2.2.6 Sat May 24 15:22:20 2008 +++ php-src/ext/standard/tests/strings/chunk_split_variation1.phpt Sun Jun 22 19:22:41 2008 @@ -118,24 +118,24 @@ string(5) "0. 5 " -- Iteration 10 -- -Notice: Array to string conversion in %s on line 87 -string(8) "Ar ra y " +Warning: chunk_split() expects parameter 1 to be string, array given in %s on line 87 +NULL -- Iteration 11 -- -Notice: Array to string conversion in %s on line 87 -string(8) "Ar ra y " +Warning: chunk_split() expects parameter 1 to be string, array given in %s on line 87 +NULL -- Iteration 12 -- -Notice: Array to string conversion in %s on line 87 -string(8) "Ar ra y " +Warning: chunk_split() expects parameter 1 to be string, array given in %s on line 87 +NULL -- Iteration 13 -- -Notice: Array to string conversion in %s on line 87 -string(8) "Ar ra y " +Warning: chunk_split() expects parameter 1 to be string, array given in %s on line 87 +NULL -- Iteration 14 -- -Notice: Array to string conversion in %s on line 87 -string(8) "Ar ra y " +Warning: chunk_split() expects parameter 1 to be string, array given in %s on line 87 +NULL -- Iteration 15 -- string(1) " " -- Iteration 16 -- @@ -163,5 +163,7 @@ -- Iteration 27 -- string(1) " " -- Iteration 28 -- -string(%d) "Re so ur ce i d #%s " -Done \ No newline at end of file + +Warning: chunk_split() expects parameter 1 to be string, resource given in %s on line 87 +NULL +Done http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/dirname_error.phpt?r1=1.1.2.1&r2=1.1.2.1.2.1&diff_format=u Index: php-src/ext/standard/tests/strings/dirname_error.phpt diff -u php-src/ext/standard/tests/strings/dirname_error.phpt:1.1.2.1 php-src/ext/standard/tests/strings/dirname_error.phpt:1.1.2.1.2.1 --- php-src/ext/standard/tests/strings/dirname_error.phpt:1.1.2.1 Fri May 25 13:44:23 2007 +++ php-src/ext/standard/tests/strings/dirname_error.phpt Sun Jun 22 19:22:41 2008 @@ -17,9 +17,9 @@ --EXPECTF-- *** Testing error conditions *** -Warning: Wrong parameter count for dirname() in %s on line %d +Warning: dirname() expects exactly 1 parameter, 0 given in %s on line %d NULL -Warning: Wrong parameter count for dirname() in %s on line %d +Warning: dirname() expects exactly 1 parameter, 2 given in %s on line %d NULL Done http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/explode1.phpt?r1=1.1.2.2.2.1&r2=1.1.2.2.2.2&diff_format=u Index: php-src/ext/standard/tests/strings/explode1.phpt diff -u php-src/ext/standard/tests/strings/explode1.phpt:1.1.2.2.2.1 php-src/ext/standard/tests/strings/explode1.phpt:1.1.2.2.2.2 --- php-src/ext/standard/tests/strings/explode1.phpt:1.1.2.2.2.1 Sun Sep 30 21:35:52 2007 +++ php-src/ext/standard/tests/strings/explode1.phpt Sun Jun 22 19:22:41 2008 @@ -501,9 +501,9 @@ *** Testing error conditions *** -Warning: Wrong parameter count for explode() in %s on line %d +Warning: explode() expects at most 3 parameters, 4 given in %s on line %d NULL -Warning: Wrong parameter count for explode() in %s on line %d +Warning: explode() expects at least 2 parameters, 1 given in %s on line %d NULL Done http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/implode1.phpt?r1=1.1.2.4.2.3&r2=1.1.2.4.2.4&diff_format=u Index: php-src/ext/standard/tests/strings/implode1.phpt http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/join_error.phpt?r1=1.1.4.4&r2=1.1.4.5&diff_format=u Index: php-src/ext/standard/tests/strings/join_error.phpt diff -u php-src/ext/standard/tests/strings/join_error.phpt:1.1.4.4 php-src/ext/standard/tests/strings/join_error.phpt:1.1.4.5 --- php-src/ext/standard/tests/strings/join_error.phpt:1.1.4.4 Mon Oct 1 12:05:41 2007 +++ php-src/ext/standard/tests/strings/join_error.phpt Sun Jun 22 19:22:41 2008 @@ -35,12 +35,12 @@ -- Testing join() function with Zero arguments -- -Warning: Wrong parameter count for join() in %s on line %d +Warning: join() expects at least 1 parameter, 0 given in %s on line %d NULL -- Testing join() function with more than expected no. of arguments -- -Warning: Wrong parameter count for join() in %s on line %d +Warning: join() expects at most 2 parameters, 3 given in %s on line %d NULL -- Testing join() with less than expected no. of arguments -- http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/ltrim.phpt?r1=1.1.2.2&r2=1.1.2.2.2.1&diff_format=u Index: php-src/ext/standard/tests/strings/ltrim.phpt diff -u php-src/ext/standard/tests/strings/ltrim.phpt:1.1.2.2 php-src/ext/standard/tests/strings/ltrim.phpt:1.1.2.2.2.1 --- php-src/ext/standard/tests/strings/ltrim.phpt:1.1.2.2 Wed Mar 28 10:44:04 2007 +++ php-src/ext/standard/tests/strings/ltrim.phpt Sun Jun 22 19:22:41 2008 @@ -52,12 +52,12 @@ *** Output for zero argument *** -Warning: Wrong parameter count for ltrim() in %s on line %d +Warning: ltrim() expects at least 1 parameter, 0 given in %s on line %d NULL *** Output for more than valid number of arguments (Valid are 1 or 2 arguments) *** -Warning: Wrong parameter count for ltrim() in %s on line %d +Warning: ltrim() expects at most 2 parameters, 3 given in %s on line %d NULL *** Using heredoc string *** http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/rtrim.phpt?r1=1.1.2.2&r2=1.1.2.2.2.1&diff_format=u Index: php-src/ext/standard/tests/strings/rtrim.phpt http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/strpos.phpt?r1=1.2.6.2.2.2&r2=1.2.6.2.2.3&diff_format=u Index: php-src/ext/standard/tests/strings/strpos.phpt diff -u php-src/ext/standard/tests/strings/strpos.phpt:1.2.6.2.2.2 php-src/ext/standard/tests/strings/strpos.phpt:1.2.6.2.2.3 --- php-src/ext/standard/tests/strings/strpos.phpt:1.2.6.2.2.2 Fri Nov 9 12:02:42 2007 +++ php-src/ext/standard/tests/strings/strpos.phpt Sun Jun 22 19:22:41 2008 @@ -251,16 +251,26 @@ *** Testing strpos() with possible variations in offset *** Position of 'Hello' with offset '1' is => int(74) -Position of 'Hello' with offset 'string' is => int(0) -Position of 'Hello' with offset '' is => int(0) +Position of 'Hello' with offset 'string' is => +Warning: strpos() expects parameter 3 to be long, string given in %s on line %d +NULL Position of 'Hello' with offset '' is => int(0) -Position of 'Hello' with offset '12string' is => int(74) +Position of 'Hello' with offset '' is => +Warning: strpos() expects parameter 3 to be long, string given in %s on line %d +NULL +Position of 'Hello' with offset '12string' is => +Notice: A non well formed numeric value encountered in %s on line %d +int(74) Position of 'Hello' with offset '0' is => int(0) Position of 'Hello' with offset '1' is => int(74) Position of 'Hello' with offset '' is => int(0) Position of 'Hello' with offset '' is => int(0) -Position of 'Hello' with offset 'string12' is => int(0) -Position of 'Hello' with offset '12.3string' is => int(74) +Position of 'Hello' with offset 'string12' is => +Warning: strpos() expects parameter 3 to be long, string given in %s on line %d +NULL +Position of 'Hello' with offset '12.3string' is => +Notice: A non well formed numeric value encountered in %s on line %d +int(74) *** Testing Miscelleneous input data *** -- Passing objects as string and needle -- @@ -268,14 +278,18 @@ -- Passing an array as string and needle -- -Notice: Array to string conversion in %s on line %d -bool(false) +Warning: strpos() expects parameter 1 to be string, array given in %s on line %d +NULL int(5) int(12) -- Passing Resources as string and needle -- -%s -%s + +Warning: strpos() expects parameter 1 to be string, resource given in %s on line %d +NULL + +Warning: strpos() expects parameter 1 to be string, resource given in %s on line %d +NULL -- Posiibilities with null -- bool(false) @@ -315,16 +329,16 @@ Warning: strpos(): Empty delimiter in %s on line %d bool(false) -Warning: Wrong parameter count for strpos() in %s on line %d +Warning: strpos() expects at least 2 parameters, 0 given in %s on line %d NULL -Warning: Wrong parameter count for strpos() in %s on line %d +Warning: strpos() expects at least 2 parameters, 1 given in %s on line %d NULL -Warning: Wrong parameter count for strpos() in %s on line %d +Warning: strpos() expects at least 2 parameters, 1 given in %s on line %d NULL -Warning: Wrong parameter count for strpos() in %s on line %d +Warning: strpos() expects at most 3 parameters, 4 given in %s on line %d NULL Warning: strpos(): Offset not contained in string in %s on line %d http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/strrchr_error.phpt?r1=1.2.2.2&r2=1.2.2.3&diff_format=u Index: php-src/ext/standard/tests/strings/strrchr_error.phpt diff -u php-src/ext/standard/tests/strings/strrchr_error.phpt:1.2.2.2 php-src/ext/standard/tests/strings/strrchr_error.phpt:1.2.2.3 --- php-src/ext/standard/tests/strings/strrchr_error.phpt:1.2.2.2 Sat Sep 29 16:59:07 2007 +++ php-src/ext/standard/tests/strings/strrchr_error.phpt Sun Jun 22 19:22:41 2008 @@ -27,14 +27,14 @@ *** Testing strrchr() function: error conditions *** -- Testing strrchr() function with Zero arguments -- -Warning: Wrong parameter count for strrchr() in %s on line %d +Warning: strrchr() expects exactly 2 parameters, 0 given in %s on line %d NULL -- Testing strrchr() function with less than expected no. of arguments -- -Warning: Wrong parameter count for strrchr() in %s on line %d +Warning: strrchr() expects exactly 2 parameters, 1 given in %s on line %d NULL -- Testing strrchr() function with more than expected no. of arguments -- -Warning: Wrong parameter count for strrchr() in %s on line %d +Warning: strrchr() expects exactly 2 parameters, 3 given in %s on line %d NULL *** Done *** http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/strrchr_variation11.phpt?r1=1.2.2.3&r2=1.2.2.4&diff_format=u Index: php-src/ext/standard/tests/strings/strrchr_variation11.phpt diff -u php-src/ext/standard/tests/strings/strrchr_variation11.phpt:1.2.2.3 php-src/ext/standard/tests/strings/strrchr_variation11.phpt:1.2.2.4 --- php-src/ext/standard/tests/strings/strrchr_variation11.phpt:1.2.2.3 Fri Nov 9 12:02:42 2007 +++ php-src/ext/standard/tests/strings/strrchr_variation11.phpt Sun Jun 22 19:22:41 2008 @@ -110,24 +110,24 @@ bool(false) -- Iteration 10 -- -Notice: Array to string conversion in %s on line %d -bool(false) +Warning: strrchr() expects parameter 1 to be string, array given in %s on line %d +NULL -- Iteration 11 -- -Notice: Array to string conversion in %s on line %d -bool(false) +Warning: strrchr() expects parameter 1 to be string, array given in %s on line %d +NULL -- Iteration 12 -- -Notice: Array to string conversion in %s on line %d -bool(false) +Warning: strrchr() expects parameter 1 to be string, array given in %s on line %d +NULL -- Iteration 13 -- -Notice: Array to string conversion in %s on line %d -bool(false) +Warning: strrchr() expects parameter 1 to be string, array given in %s on line %d +NULL -- Iteration 14 -- -Notice: Array to string conversion in %s on line %d -bool(false) +Warning: strrchr() expects parameter 1 to be string, array given in %s on line %d +NULL -- Iteration 15 -- bool(false) -- Iteration 16 -- @@ -149,7 +149,9 @@ -- Iteration 23 -- bool(false) -- Iteration 24 -- -%s + +Warning: strrchr() expects parameter 1 to be string, resource given in %s on line %d +NULL -- Iteration 25 -- bool(false) -- Iteration 26 -- http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/strrchr_variation9.phpt?r1=1.2.2.2&r2=1.2.2.3&diff_format=u Index: php-src/ext/standard/tests/strings/strrchr_variation9.phpt diff -u php-src/ext/standard/tests/strings/strrchr_variation9.phpt:1.2.2.2 php-src/ext/standard/tests/strings/strrchr_variation9.phpt:1.2.2.3 --- php-src/ext/standard/tests/strings/strrchr_variation9.phpt:1.2.2.2 Sat Sep 29 16:59:07 2007 +++ php-src/ext/standard/tests/strings/strrchr_variation9.phpt Sun Jun 22 19:22:41 2008 @@ -151,24 +151,24 @@ string(2) ".5" -- Iteration 10 -- -Notice: Array to string conversion in %s on line %d -string(2) "ay" +Warning: strrchr() expects parameter 1 to be string, array given in %s on line %d +NULL -- Iteration 11 -- -Notice: Array to string conversion in %s on line %d -string(2) "ay" +Warning: strrchr() expects parameter 1 to be string, array given in %s on line %d +NULL -- Iteration 12 -- -Notice: Array to string conversion in %s on line %d -string(3) "ray" +Warning: strrchr() expects parameter 1 to be string, array given in %s on line %d +NULL -- Iteration 13 -- -Notice: Array to string conversion in %s on line %d -string(1) "y" +Warning: strrchr() expects parameter 1 to be string, array given in %s on line %d +NULL -- Iteration 14 -- -Notice: Array to string conversion in %s on line %d -string(2) "ay" +Warning: strrchr() expects parameter 1 to be string, array given in %s on line %d +NULL -- Iteration 15 -- bool(false) -- Iteration 16 -- @@ -188,7 +188,9 @@ -- Iteration 23 -- bool(false) -- Iteration 24 -- -bool(false) + +Warning: strrchr() expects parameter 1 to be string, resource given in %s on line %d +NULL -- Iteration 25 -- bool(false) -- Iteration 26 -- http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/trim1.phpt?r1=1.1.2.1&r2=1.1.2.1.2.1&diff_format=u Index: php-src/ext/standard/tests/strings/trim1.phpt
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php