Home
last modified time | relevance | path

Searched refs:strncmp (Results 1 – 25 of 97) sorted by relevance

1234

/PHP-5.4/ext/standard/tests/strings/
H A Dstrncmp_basic.phpt2 Test strncmp() function : basic functionality
12 echo "-- Testing strncmp() with single quoted string --\n";
13 var_dump( strncmp('Hello', 'Hello', 5) ); //expected: int(0)
17 echo "-- Testing strncmp() with double quoted string --\n";
22 echo "-- Testing strncmp() with here-doc string --\n";
26 var_dump( strncmp($str, "Hello", 5) ); //expected: int(0)
27 var_dump( strncmp($str, "Hi", 5) ); //expected: value < 0
28 var_dump( strncmp("Hi", $str, 5) ); //expected: value > 0
34 -- Testing strncmp\(\) with single quoted string --
38 -- Testing strncmp\(\) with double quoted string --
[all …]
H A Dstrncmp_error.phpt2 Test strncmp() function : error conditions
5 /* Prototype : int strncmp ( string $str1, string $str2, int $len );
10 /* Test strncmp() function with more/less number of args and invalid args */
12 echo "*** Testing strncmp() function: error conditions ***\n";
18 var_dump( strncmp() ); //Zero argument
19 var_dump( strncmp($str1) ); //One argument, less than expected no. of args
25 var_dump( strncmp($str1, $str2, $len) );
29 *** Testing strncmp() function: error conditions ***
31 Warning: strncmp() expects exactly 3 parameters, 0 given in %s on line %d
34 Warning: strncmp() expects exactly 3 parameters, 1 given in %s on line %d
[all …]
H A Dstrncmp_variation5.phpt2 Test strncmp() function : usage variations - different lengths(all types)
5 /* Prototype : int strncmp ( string $str1, string $str2, int $len );
12 echo "*** Test strncmp() function: by supplying all types for 'len' ***\n";
87 /* loop through each element of the array and check the working of strncmp() */
92 var_dump( strncmp($str1, $str2, $len) );
100 *** Test strncmp() function: by supplying all types for 'len' ***
127 Warning: strncmp() expects parameter 3 to be long, array given in%s on line %d
131 Warning: strncmp() expects parameter 3 to be long, array given in%s on line %d
135 Warning: strncmp() expects parameter 3 to be long, array given in%s on line %d
139 Warning: strncmp() expects parameter 3 to be long, array given in%s on line %d
[all …]
H A Dstrncmp_variation3.phpt2 Test strncmp() function: usage variations - different lengths
5 /* Prototype : int strncmp ( string $str1, string $str2, int $len );
10 /* Test strncmp() with various lengths */
12 echo "*** Test strncmp() function: with different lengths ***\n";
19 var_dump( strncmp($str1, $str2, $len) );
24 \*\*\* Test strncmp\(\) function: with different lengths \*\*\*
H A Dstrncmp_variation7.phpt2 Test strncmp() function : usage variations - binary safe(null terminated strings)
5 /* Prototype : int strncmp ( string $str1, string $str2, int $len );
10 /* Test strncmp() function with binary values passed to 'str1' & 'str2' and with the null terminate…
12 echo "*** Test strncmp() function: Checking with the null terminated strings ***\n";
17 var_dump( strncmp($str1, $str2, 12) ); //expected: int(5);
22 *** Test strncmp() function: Checking with the null terminated strings ***
H A Dstrncmp_variation8.phpt2 Test strncmp() function: usage variations - single quoted strings
5 /* Prototype : int strncmp ( string $str1, string $str2, int $len );
10 /* Test strncmp() function with single quoted strings for 'str1', 'str2' */
12 echo "*** Test strncmp() function: with single quoted strings ***\n";
24 var_dump( strncmp( $strings[$index1], $strings[$index2], (strlen($strings[$index1]) + 1) ) );
31 \*\*\* Test strncmp\(\) function: with single quoted strings \*\*\*
H A Dstrncmp_variation1.phpt2 Test strncmp() function: usage variations - case-sensitivity
5 /* Prototype : int strncmp ( string $str1, string $str2, int $len );
10 /* Test strncmp() function with upper-case and lower-case alphabets as inputs for 'str1' and 'str2'…
12 echo "*** Test strncmp() function: with alphabets ***\n";
15 …var_dump( strncmp( chr($ASCII), chr($ASCII), 1 ) ); //comparing uppercase letters with uppercase …
16 …var_dump( strncmp( chr($ASCII), chr($ASCII + 32), 1 ) ); //comparing uppercase letters with lower…
21 …var_dump( strncmp( chr($ASCII), chr($ASCII), 1 ) ); //comparing lowercase letters with lowercase …
22 …var_dump( strncmp( chr($ASCII), chr($ASCII - 32), 1 ) ); //comparing lowercase letters with upper…
27 \*\*\* Test strncmp\(\) function: with alphabets \*\*\*
H A Dstrncmp_variation2.phpt2 Test strncmp() function: usage variations - double quoted strings
5 /* Prototype : int strncmp ( string $str1, string $str2, int $len );
10 /* Test strncmp() function with double quoted strings for 'str1', 'str2' */
12 echo "*** Test strncmp() function: with double quoted strings ***\n";
25 var_dump( strncmp( $strings[$index1], $strings[$index2], (strlen($strings[$index1]) + 1) ) );
32 \*\*\* Test strncmp\(\) function: with double quoted strings \*\*\*
H A Dstrncmp_variation4.phpt2 Test strncmp() function : usage variations - different inputs(all types)
5 /* Prototype : int strncmp ( string $str1, string $str2, int $len );
10 /* Test strncmp() function with the input strings are of all types */
86 /* loop through each element of the array and check the working of strncmp() */
93 var_dump( strncmp($str1, $str2, $len) );
101 *** Testing strncmp() function: by supplying all types for 'str1' and 'str2' ***
138 Warning: strncmp() expects parameter 1 to be string, array given in %s on line %d
144 Warning: strncmp() expects parameter 1 to be string, array given in %s on line %d
150 Warning: strncmp() expects parameter 1 to be string, array given in %s on line %d
156 Warning: strncmp() expects parameter 1 to be string, array given in %s on line %d
[all …]
H A Dstrncmp_variation9.phpt2 Test strncmp() function: usage variations - different inputs(heredoc strings)
5 /* Prototype : int strncmp ( string $str1, string $str2, int $len );
10 /* Test strncmp() function with different strings for 'str1', 'str2' and considering case sensitive…
12 echo "*** Test strncmp() function: with different input strings ***\n";
50 var_dump( strncmp( $strings[$index1], $strings[$index1], strlen($strings[$index1]) ) );
56 *** Test strncmp() function: with different input strings ***
H A Dbug36944.phpt2 Bug #36944 (strncmp & strncasecmp do not return false on negative string length)
6 var_dump(strncmp("test ", "e", -1));
7 var_dump(strncmp("test ", "e", 10));
8 var_dump(strncmp("test ", "e", 0));
H A Dstrncmp_variation6.phpt2 Test strncmp() function : usage variations - binary safe(binary values)
5 /* Prototype : int strncmp ( string $str1, string $str2, int $len );
10 /* Test strncmp() function with binary values passed to 'str1' & 'str2' and with the null terminate…
12 echo "*** Test strncmp() function: with binary inputs ***\n";
16 /* loop through to get all 256 character's equivelent binary value, and check working of strncmp() …
22 var_dump( strncmp($str1, $str2, 8) ); //comparing all the 8-bits; expected: int(0)
23 var_dump( strncmp($str1, $str2, 4) ); //comparing only 4-bits; expected: int(0)
31 var_dump( strncmp($str1, $str2, 8) ); //comparing all the 8-bits; expected: int(1)
36 *** Test strncmp() function: with binary inputs ***
/PHP-5.4/Zend/tests/
H A D004.phpt2 strncmp() tests
6 var_dump(strncmp("", ""));
7 var_dump(strncmp("", "", 100));
8 var_dump(strncmp("aef", "dfsgbdf", -1));
9 var_dump(strncmp("fghjkl", "qwer", 0));
10 var_dump(strncmp("qwerty", "qwerty123", 6));
11 var_dump(strncmp("qwerty", "qwerty123", 7));
16 Warning: strncmp() expects exactly 3 parameters, 2 given in %s on line %d
/PHP-5.4/ext/standard/
H A Dversioning.c109 if (strncmp(form1, pp->name, strlen(pp->name)) == 0) { in compare_special_version_forms()
115 if (strncmp(form2, pp->name, strlen(pp->name)) == 0) { in compare_special_version_forms()
226 if (!strncmp(op, "<", op_len) || !strncmp(op, "lt", op_len)) { in PHP_FUNCTION()
229 if (!strncmp(op, "<=", op_len) || !strncmp(op, "le", op_len)) { in PHP_FUNCTION()
232 if (!strncmp(op, ">", op_len) || !strncmp(op, "gt", op_len)) { in PHP_FUNCTION()
235 if (!strncmp(op, ">=", op_len) || !strncmp(op, "ge", op_len)) { in PHP_FUNCTION()
238 if (!strncmp(op, "==", op_len) || !strncmp(op, "=", op_len) || !strncmp(op, "eq", op_len)) { in PHP_FUNCTION()
241 if (!strncmp(op, "!=", op_len) || !strncmp(op, "<>", op_len) || !strncmp(op, "ne", op_len)) { in PHP_FUNCTION()
H A Ddl.c73 if ((strncmp(sapi_module.name, "cgi", 3) != 0) && in PHP_FUNCTION()
75 (strncmp(sapi_module.name, "embed", 5) != 0) in PHP_FUNCTION()
H A Dphp_crypt_r.c153 if (strncmp(sp, MD5_MAGIC, MD5_MAGIC_LEN) == 0) { in php_md5_crypt_r()
335 if (strncmp(sp, MD5_MAGIC, MD5_MAGIC_LEN) == 0) in php_md5_crypt_r()
/PHP-5.4/ext/tokenizer/tests/
H A Dtoken_get_all_variation19.phpt39 if (strncmp($token[1], '<?php', 5) == 0) {
42 if (strncmp($token[1], '?>', 2) == 0) {
/PHP-5.4/ext/readline/
H A Dreadline_cli.c354 …if (code[i - (heredoc_len + 1)] == '\n' && !strncmp(code + i - heredoc_len, heredoc_tag, heredoc_l… in cli_is_valid_code()
356 …} else if (code[i - (heredoc_len + 2)] == '\n' && !strncmp(code + i - heredoc_len - 1, heredoc_tag… in cli_is_valid_code()
362 if ((CG(short_tags) && !strncmp(code+i-1, "<?", 2)) in cli_is_valid_code()
363 || (CG(asp_tags) && !strncmp(code+i-1, "<%", 2)) in cli_is_valid_code()
364 || (i > 3 && !strncmp(code+i-4, "<?php", 5)) in cli_is_valid_code()
420 if (!textlen || !strncmp(name, text, textlen)) { in cli_completion_generator_ht()
/PHP-5.4/sapi/cli/tests/
H A Dphp_cli_server_004.phpt12 php_cli_server_start('foreach($_SERVER as $k=>$v) { if (!strncmp($k, "HTTP", 4)) var_dump( $k . ":"…
/PHP-5.4/ext/sybase_ct/tests/
H A Dtest_appname.phpt18 return (0 == strncmp($expect, $trimmed, strlen($trimmed)));
/PHP-5.4/ext/standard/tests/file/
H A Dclearstatcache_001.phpt5 if (strncmp(PHP_OS, "WIN", 3) === 0) {
/PHP-5.4/ext/fileinfo/libmagic/
H A Dapptype.c132 if (strncmp((const char *)buf, "MZ", 2)) in file_os2_apptype()
/PHP-5.4/ext/dba/
H A Ddba_db4.c53 && (!strncmp(msg, "fop_read_meta", sizeof("fop_read_meta")-1) in php_dba_db4_errcall_fcn()
54 || !strncmp(msg, "BDB0004 fop_read_meta", sizeof("BDB0004 fop_read_meta")-1))) { in php_dba_db4_errcall_fcn()
/PHP-5.4/ext/ereg/regex/
H A Dmain.c174 if (strncmp(erbuf, badpat, SHORT-1) != 0 || erbuf[SHORT-1] != '\0' ||
458 if (len != shlen || strncmp(p, should, (size_t)shlen) != 0) {
471 if (strncmp(p, at, shlen) != 0) {
/PHP-5.4/main/
H A Dgetopt.c107 …} else if (opts[php_optidx].opt_name && !strncmp(&argv[*optind][2], opts[php_optidx].opt_name, arg… in php_getopt()

Completed in 35 milliseconds

1234