diff options
| author | Ondřej Surý <ondrej@sury.org> | 2010-01-07 13:31:53 +0100 |
|---|---|---|
| committer | Ondřej Surý <ondrej@sury.org> | 2010-01-07 13:31:53 +0100 |
| commit | 0fab6db7cac8d2be99579dd049f812a8ff98e74f (patch) | |
| tree | 91f01b0d06916c78262404096bfd466b8e95e5b5 /ext/standard/tests/strings | |
| parent | d3a8757891280dc6650ca7eead67830c794b0e7b (diff) | |
| download | php-upstream/5.3.1.tar.gz | |
Imported Upstream version 5.3.1upstream/5.3.1
Diffstat (limited to 'ext/standard/tests/strings')
62 files changed, 1523 insertions, 410 deletions
diff --git a/ext/standard/tests/strings/006.phpt b/ext/standard/tests/strings/006.phpt index 3c9d6481a..fdfd58c02 100644 --- a/ext/standard/tests/strings/006.phpt +++ b/ext/standard/tests/strings/006.phpt @@ -15,7 +15,7 @@ var_dump(ob_get_contents()); ?> ===DONE=== --EXPECTF-- -Warning: highlight_file(AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA): failed to open stream: File name too long in %s006.php on line %d +Warning: highlight_file(AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA): failed to open stream: %s006.php on line %d Warning: highlight_file(): Failed opening 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' for highlighting in %s006.php on line %d bool(false) diff --git a/ext/standard/tests/strings/addslashes_basic.phpt b/ext/standard/tests/strings/addslashes_basic.phpt index 6ed121067..0912d34e4 100644 --- a/ext/standard/tests/strings/addslashes_basic.phpt +++ b/ext/standard/tests/strings/addslashes_basic.phpt @@ -1,6 +1,5 @@ --TEST-- Test addslashes() function : basic functionality ---INI-- --FILE-- <?php /* Prototype : string addslashes ( string $str ) @@ -36,4 +35,4 @@ string(16) "How\'s everybody" string(17) "Are you \"JOHN\"?" string(19) "c:\\php\\addslashes" string(12) "hello\0world" -Done
\ No newline at end of file +Done diff --git a/ext/standard/tests/strings/addslashes_error.phpt b/ext/standard/tests/strings/addslashes_error.phpt index 4ebd88785..e920dfd1c 100644 --- a/ext/standard/tests/strings/addslashes_error.phpt +++ b/ext/standard/tests/strings/addslashes_error.phpt @@ -1,6 +1,5 @@ --TEST-- Test addslashes() function : error conditions ---INI-- --FILE-- <?php /* Prototype : string addslashes ( string $str ) diff --git a/ext/standard/tests/strings/addslashes_variation1.phpt b/ext/standard/tests/strings/addslashes_variation1.phpt index 93bb69dd1..cc245ae04 100644 --- a/ext/standard/tests/strings/addslashes_variation1.phpt +++ b/ext/standard/tests/strings/addslashes_variation1.phpt @@ -1,6 +1,5 @@ --TEST-- Test addslashes() function : usage variations - non-string type argument ---INI-- --FILE-- <?php /* Prototype : string addslashes ( string $str ) @@ -169,4 +168,4 @@ NULL string(0) "" -- Iteration 26 -- string(0) "" -===DONE===
\ No newline at end of file +===DONE=== diff --git a/ext/standard/tests/strings/addslashes_variation2.phpt b/ext/standard/tests/strings/addslashes_variation2.phpt index 285d9058a..49009e810 100644 --- a/ext/standard/tests/strings/addslashes_variation2.phpt +++ b/ext/standard/tests/strings/addslashes_variation2.phpt @@ -1,6 +1,5 @@ --TEST-- Test addslashes() function : usage variations - strings with characters to be backslashed ---INI-- --FILE-- <?php /* Prototype : string addslashes ( string $str ) @@ -192,4 +191,4 @@ This is line 2 of \"heredoc\" string" -- Iteration 34 -- string(0) "" -Done
\ No newline at end of file +Done diff --git a/ext/standard/tests/strings/addslashes_variation3.phpt b/ext/standard/tests/strings/addslashes_variation3.phpt index 302ca7e18..8f46ebe9a 100644 --- a/ext/standard/tests/strings/addslashes_variation3.phpt +++ b/ext/standard/tests/strings/addslashes_variation3.phpt @@ -1,6 +1,5 @@ --TEST-- Test addslashes() function : usage variations - with magic_quotes_sybase directive ON ---INI-- --FILE-- <?php /* Prototype : string addslashes ( string $str ) diff --git a/ext/standard/tests/strings/bug38770.phpt b/ext/standard/tests/strings/bug38770.phpt index 75522ee9d..417794cd2 100644 --- a/ext/standard/tests/strings/bug38770.phpt +++ b/ext/standard/tests/strings/bug38770.phpt @@ -1,5 +1,9 @@ --TEST-- Bug #38770 (unpack() broken with longs on 64 bit machines) +--SKIPIF-- +<?php +if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only"); +?> --FILE-- <?php diff --git a/ext/standard/tests/strings/bug47481.phpt b/ext/standard/tests/strings/bug47481.phpt new file mode 100644 index 000000000..4c59a7c37 --- /dev/null +++ b/ext/standard/tests/strings/bug47481.phpt @@ -0,0 +1,57 @@ +--TEST-- +Bug #47481 (natcasesort() does not sort extended ASCII characters correctly) +--FILE-- +<?php +/* Prototype : bool natcasesort(array &$array_arg) + * Description: Sort an array using case-insensitive natural sort + * Source code: ext/standard/array.c + */ + +/* + * Test natcasesort() with extended ASCII characters + */ + +$array = array ('Süden', 'spielen','Sonne','Wind','Regen','Meer'); +echo "\n-- Before sorting: --\n"; +var_dump($array); + +echo "\n-- After Sorting: --\n"; +var_dump(natcasesort($array)); +var_dump($array); + +echo "Done"; +?> +--EXPECTF-- +-- Before sorting: -- +array(6) { + [0]=> + %string|unicode%(6) "Süden" + [1]=> + %string|unicode%(7) "spielen" + [2]=> + %string|unicode%(5) "Sonne" + [3]=> + %string|unicode%(4) "Wind" + [4]=> + %string|unicode%(5) "Regen" + [5]=> + %string|unicode%(4) "Meer" +} + +-- After Sorting: -- +bool(true) +array(6) { + [5]=> + %string|unicode%(4) "Meer" + [4]=> + %string|unicode%(5) "Regen" + [2]=> + %string|unicode%(5) "Sonne" + [1]=> + %string|unicode%(7) "spielen" + [0]=> + %string|unicode%(6) "Süden" + [3]=> + %string|unicode%(4) "Wind" +} +Done diff --git a/ext/standard/tests/strings/bug48709.phpt b/ext/standard/tests/strings/bug48709.phpt new file mode 100644 index 000000000..999a2c651 --- /dev/null +++ b/ext/standard/tests/strings/bug48709.phpt @@ -0,0 +1,31 @@ +--TEST-- +Bug #48709 (metaphone and 'wh') +--FILE-- +<?php + +/* Initial letter exceptions */ +$exceptions = array( + 'kn', // Drop first letter + 'gn', // ditto + 'pn', // ditto + 'ae', // ditto + 'wr', // ditto + 'x', // s + 'wh', // w + 'wa' // w +); + +foreach ($exceptions as $letter) { + printf("%s => %s\n", $letter, metaphone($letter)); +} + +?> +--EXPECT-- +kn => N +gn => N +pn => N +ae => E +wr => R +x => S +wh => W +wa => W diff --git a/ext/standard/tests/strings/bug50052.phpt b/ext/standard/tests/strings/bug50052.phpt new file mode 100644 index 000000000..24a5a201f --- /dev/null +++ b/ext/standard/tests/strings/bug50052.phpt @@ -0,0 +1,12 @@ +--TEST--
+Bug #20934 (html_entity_decode() crash when "" is passed)
+--FILE--
+<?php
+$salt = '$1$f+uslYF01$';
+$password = 'test';
+echo $salt . "\n";
+echo crypt($password,$salt) . "\n";
+?>
+--EXPECT--
+$1$f+uslYF01$
+$1$f+uslYF0$orVloNmKSLvOeswusE0bY.
diff --git a/ext/standard/tests/strings/chunk_split_variation2.phpt b/ext/standard/tests/strings/chunk_split_variation2.phpt index 752a5d870..d49ec3b1b 100644 --- a/ext/standard/tests/strings/chunk_split_variation2.phpt +++ b/ext/standard/tests/strings/chunk_split_variation2.phpt @@ -35,10 +35,10 @@ $values = array( // float data 10.5, -10.5, - 10.1234567e10, - 10.7654321E-10, + (float) PHP_INT_MAX + 1, + (float) -PHP_INT_MAX - 1, .5, - + // array data array(), array(0), @@ -83,12 +83,11 @@ for($count = 0; $count < count($values); $count++) { var_dump( chunk_split($str, $values[$count], $ending) ); } -echo "Done"; - //closing resource fclose($fp); ?> +===DONE=== --EXPECTF-- *** Testing chunk_split() : with unexpected values for 'chunklen' argument *** -- Iteration 1 -- @@ -111,16 +110,24 @@ Warning: chunk_split(): Chunk length should be greater than zero in %schunk_spli bool(false) -- Iteration 6 -- -Warning: chunk_split(): Chunk length should be greater than zero in %schunk_split_variation2.php on line %d -bool(false) +Warning: chunk_split() expects parameter 2 to be long, array given in %schunk_split_variation2.php on line %d +NULL -- Iteration 7 -- -string(50) "T*h*i*s* *i*s* *c*h*u*k*l*e*n* *v*a*r*i*a*t*i*o*n*" + +Warning: chunk_split() expects parameter 2 to be long, array given in %schunk_split_variation2.php on line %d +NULL -- Iteration 8 -- -string(50) "T*h*i*s* *i*s* *c*h*u*k*l*e*n* *v*a*r*i*a*t*i*o*n*" + +Warning: chunk_split() expects parameter 2 to be long, array given in %schunk_split_variation2.php on line %d +NULL -- Iteration 9 -- -string(50) "T*h*i*s* *i*s* *c*h*u*k*l*e*n* *v*a*r*i*a*t*i*o*n*" + +Warning: chunk_split() expects parameter 2 to be long, array given in %schunk_split_variation2.php on line %d +NULL -- Iteration 10 -- -string(50) "T*h*i*s* *i*s* *c*h*u*k*l*e*n* *v*a*r*i*a*t*i*o*n*" + +Warning: chunk_split() expects parameter 2 to be long, array given in %schunk_split_variation2.php on line %d +NULL -- Iteration 11 -- Warning: chunk_split(): Chunk length should be greater than zero in %schunk_split_variation2.php on line %d @@ -143,24 +150,24 @@ Warning: chunk_split(): Chunk length should be greater than zero in %schunk_spli bool(false) -- Iteration 17 -- -Warning: chunk_split(): Chunk length should be greater than zero in %schunk_split_variation2.php on line %d -bool(false) +Warning: chunk_split() expects parameter 2 to be long, string given in %schunk_split_variation2.php on line %d +NULL -- Iteration 18 -- -Warning: chunk_split(): Chunk length should be greater than zero in %schunk_split_variation2.php on line %d -bool(false) +Warning: chunk_split() expects parameter 2 to be long, string given in %schunk_split_variation2.php on line %d +NULL -- Iteration 19 -- -Warning: chunk_split(): Chunk length should be greater than zero in %schunk_split_variation2.php on line %d -bool(false) +Warning: chunk_split() expects parameter 2 to be long, string given in %schunk_split_variation2.php on line %d +NULL -- Iteration 20 -- -Warning: chunk_split(): Chunk length should be greater than zero in %schunk_split_variation2.php on line %d -bool(false) +Warning: chunk_split() expects parameter 2 to be long, string given in %schunk_split_variation2.php on line %d +NULL -- Iteration 21 -- -Notice: Object of class MyClass could not be converted to int in %schunk_split_variation2.php on line %d -string(50) "T*h*i*s* *i*s* *c*h*u*k*l*e*n* *v*a*r*i*a*t*i*o*n*" +Warning: chunk_split() expects parameter 2 to be long, object given in %schunk_split_variation2.php on line %d +NULL -- Iteration 22 -- Warning: chunk_split(): Chunk length should be greater than zero in %schunk_split_variation2.php on line %d @@ -170,5 +177,7 @@ bool(false) Warning: chunk_split(): Chunk length should be greater than zero in %schunk_split_variation2.php on line %d bool(false) -- Iteration 24 -- -string(30) "This *is ch*uklen* vari*ation*" -Done + +Warning: chunk_split() expects parameter 2 to be long, resource given in %schunk_split_variation2.php on line %d +NULL +===DONE=== diff --git a/ext/standard/tests/strings/chunk_split_variation3.phpt b/ext/standard/tests/strings/chunk_split_variation3.phpt index f314990c7..758bec088 100644 --- a/ext/standard/tests/strings/chunk_split_variation3.phpt +++ b/ext/standard/tests/strings/chunk_split_variation3.phpt @@ -113,24 +113,24 @@ string(100) "This1.07654321E-9 is 1.07654321E-9simp1.07654321E-9le s1.07654321E- string(40) "This0.5 is 0.5simp0.5le s0.5trin0.5g.0.5" -- Iteration 10 -- -Notice: Array to string conversion in %s on line %d -string(52) "ThisArray is ArraysimpArrayle sArraytrinArrayg.Array" +Warning: chunk_split() expects parameter 3 to be string, array given in %s on line %d +NULL -- Iteration 11 -- -Notice: Array to string conversion in %s on line %d -string(52) "ThisArray is ArraysimpArrayle sArraytrinArrayg.Array" +Warning: chunk_split() expects parameter 3 to be string, array given in %s on line %d +NULL -- Iteration 12 -- -Notice: Array to string conversion in %s on line %d -string(52) "ThisArray is ArraysimpArrayle sArraytrinArrayg.Array" +Warning: chunk_split() expects parameter 3 to be string, array given in %s on line %d +NULL -- Iteration 13 -- -Notice: Array to string conversion in %s on line %d -string(52) "ThisArray is ArraysimpArrayle sArraytrinArrayg.Array" +Warning: chunk_split() expects parameter 3 to be string, array given in %s on line %d +NULL -- Iteration 14 -- -Notice: Array to string conversion in %s on line %d -string(52) "ThisArray is ArraysimpArrayle sArraytrinArrayg.Array" +Warning: chunk_split() expects parameter 3 to be string, array given in %s on line %d +NULL -- Iteration 15 -- string(22) "This is simple string." -- Iteration 16 -- @@ -154,5 +154,7 @@ string(22) "This is simple string." -- Iteration 25 -- string(22) "This is simple string." -- Iteration 26 -- -string(%d) "ThisResource id #%d is Resource id #%dsimpResource id #%dle sResource id #%dtrinResource id #%dg.Resource id #%d" + +Warning: chunk_split() expects parameter 3 to be string, resource given in %s on line %d +NULL Done
\ No newline at end of file diff --git a/ext/standard/tests/strings/chunk_split_variation5.phpt b/ext/standard/tests/strings/chunk_split_variation5.phpt Binary files differindex e01c126d3..580f8f0a6 100644 --- a/ext/standard/tests/strings/chunk_split_variation5.phpt +++ b/ext/standard/tests/strings/chunk_split_variation5.phpt diff --git a/ext/standard/tests/strings/chunk_split_variation8.phpt b/ext/standard/tests/strings/chunk_split_variation8.phpt index 6f8f2cde7..cfb440e92 100644 --- a/ext/standard/tests/strings/chunk_split_variation8.phpt +++ b/ext/standard/tests/strings/chunk_split_variation8.phpt @@ -1,5 +1,9 @@ --TEST-- Test chunk_split() function : usage variations - different integer values for 'chunklen' with heredoc string as 'str'(Bug#42796) +--SKIPIF-- +<?php +if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only"); +?> --FILE-- <?php /* Prototype : string chunk_split(string $str [, int $chunklen [, string $ending]]) @@ -32,9 +36,9 @@ $values = array ( -123, //negative integer 0234, //octal number 0x1A, //hexadecimal number - PHP_INT_MAX, //max positive integer number - PHP_INT_MAX * 3, // Will overflow 32 bits on 32 bt system and 64 bits on 64 bit system - -PHP_INT_MAX -1, //min negative integer + PHP_INT_MAX, // max positive integer number + PHP_INT_MAX * 3, // integer overflow + -PHP_INT_MAX - 1, // min negative integer ); @@ -78,10 +82,9 @@ string(129) "This's heredoc string with and It has _speci@l ch@r$ 2222 !!!Now \k as escape char to test chunk_split():::" -- Iteration 7 -- -string(129) "This's heredoc string with and - white space char. -It has _speci@l ch@r$ 2222 !!!Now \k as escape char to test -chunk_split():::" + +Warning: chunk_split(): Chunk length should be greater than zero in %s on line %d +bool(false) -- Iteration 8 -- Warning: chunk_split(): Chunk length should be greater than zero in %s on line %d diff --git a/ext/standard/tests/strings/explode_variation1.phpt b/ext/standard/tests/strings/explode_variation1.phpt index abb3c3223..9c9ce1169 100644 --- a/ext/standard/tests/strings/explode_variation1.phpt +++ b/ext/standard/tests/strings/explode_variation1.phpt @@ -133,25 +133,16 @@ array(1) { } -- Iteration 10 -- -Notice: Array to string conversion in %s on line %d -array(1) { - [0]=> - string(41) "piece1 piece2 piece3 piece4 piece5 piece6" -} +Warning: explode() 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 -array(1) { - [0]=> - string(41) "piece1 piece2 piece3 piece4 piece5 piece6" -} +Warning: explode() 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 -array(1) { - [0]=> - string(41) "piece1 piece2 piece3 piece4 piece5 piece6" -} +Warning: explode() expects parameter 1 to be string, array given in %s on line %d +NULL -- Iteration 13 -- array(2) { [0]=> @@ -188,10 +179,9 @@ array(1) { string(41) "piece1 piece2 piece3 piece4 piece5 piece6" } -- Iteration 20 -- -array(1) { - [0]=> - string(%d) "%s" -} + +Warning: explode() expects parameter 1 to be string, resource given in %s on line %d +NULL -- Iteration 21 -- Warning: explode(): Empty delimiter in %s on line %d diff --git a/ext/standard/tests/strings/explode_variation2.phpt b/ext/standard/tests/strings/explode_variation2.phpt index f2c0057fe..9e1f72c5a 100644 --- a/ext/standard/tests/strings/explode_variation2.phpt +++ b/ext/standard/tests/strings/explode_variation2.phpt @@ -131,25 +131,16 @@ array(1) { } -- Iteration 10 -- -Notice: Array to string conversion in %s on line %d -array(1) { - [0]=> - string(5) "Array" -} +Warning: explode() 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 -array(1) { - [0]=> - string(5) "Array" -} +Warning: explode() 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 -array(1) { - [0]=> - string(5) "Array" -} +Warning: explode() expects parameter 2 to be string, array given in %s on line %d +NULL -- Iteration 13 -- array(1) { [0]=> @@ -188,14 +179,9 @@ array(2) { string(6) "object" } -- Iteration 20 -- -array(3) { - [0]=> - string(8) "Resource" - [1]=> - string(2) "id" - [2]=> - string(%d) "#%d" -} + +Warning: explode() expects parameter 2 to be string, resource given in %s on line %d +NULL -- Iteration 21 -- array(1) { [0]=> diff --git a/ext/standard/tests/strings/htmlentities02.phpt b/ext/standard/tests/strings/htmlentities02.phpt index babec44b5..b8b9e6315 100644 --- a/ext/standard/tests/strings/htmlentities02.phpt +++ b/ext/standard/tests/strings/htmlentities02.phpt @@ -6,7 +6,6 @@ $result = (bool)setlocale(LC_CTYPE, "fr_FR.ISO-8859-15", "fr_FR.ISO8859-15", 'fr if (!$result) { die("skip setlocale() failed\n"); } -echo "warn possibly braindead libc\n"; ?> --INI-- output_handler= diff --git a/ext/standard/tests/strings/htmlentities04.phpt b/ext/standard/tests/strings/htmlentities04.phpt index 2d67c77f0..8e362d073 100644 --- a/ext/standard/tests/strings/htmlentities04.phpt +++ b/ext/standard/tests/strings/htmlentities04.phpt @@ -6,7 +6,6 @@ $result = (bool)setlocale(LC_CTYPE, "ja_JP.EUC-JP", "ja_JP.eucJP"); if (!$result || preg_match('/EUC[^a-zA-Z]*JP/i', setlocale(LC_CTYPE, 0)) == 0) { die("skip setlocale() failed\n"); } -echo "warn possibly braindead libc\n"; ?> --INI-- output_handler= diff --git a/ext/standard/tests/strings/htmlentities15.phpt b/ext/standard/tests/strings/htmlentities15.phpt index a15948fbe..2dc36e6f7 100644 --- a/ext/standard/tests/strings/htmlentities15.phpt +++ b/ext/standard/tests/strings/htmlentities15.phpt @@ -10,7 +10,6 @@ $result = (bool)setlocale(LC_CTYPE, "ru_RU.koi8r", "ru_RU.KOI8-R"); if (!$result || preg_match('/koi8/i', setlocale(LC_CTYPE, 0)) == 0) { die("skip setlocale() failed\n"); } -echo "warn possibly braindead libc\n"; ?> --FILE-- <?php diff --git a/ext/standard/tests/strings/join_variation6.phpt b/ext/standard/tests/strings/join_variation6.phpt Binary files differindex e8d098115..a627d77bf 100644 --- a/ext/standard/tests/strings/join_variation6.phpt +++ b/ext/standard/tests/strings/join_variation6.phpt diff --git a/ext/standard/tests/strings/md5_basic1.phpt b/ext/standard/tests/strings/md5_basic1.phpt new file mode 100644 index 000000000..eda414bc2 --- /dev/null +++ b/ext/standard/tests/strings/md5_basic1.phpt @@ -0,0 +1,17 @@ +--TEST--
+Test md5() function : basic functionality
+--FILE--
+<?php
+/* Prototype : string md5 ( string $str [, bool $raw_output= false ] )
+ * Description: Calculate the md5 hash of a string
+ * Source code: ext/standard/md5.c
+*/
+
+echo "*** Testing md5() : basic functionality ***\n";
+var_dump(md5(b"apple"));
+?>
+===DONE===
+--EXPECTF--
+*** Testing md5() : basic functionality ***
+string(32) "1f3870be274f6c49b3e31a0c6728957f"
+===DONE===
diff --git a/ext/standard/tests/strings/md5_basic2.phpt b/ext/standard/tests/strings/md5_basic2.phpt new file mode 100644 index 000000000..1f89ba82f --- /dev/null +++ b/ext/standard/tests/strings/md5_basic2.phpt @@ -0,0 +1,30 @@ +--TEST--
+Test md5() function : basic functionality - with raw output
+--FILE--
+<?php
+/* Prototype : string md5 ( string $str [, bool $raw_output= false ] )
+ * Description: Calculate the md5 hash of a string
+ * Source code: ext/standard/md5.c
+*/
+
+echo "*** Testing md5() : basic functionality - with raw output***\n";
+$str = b"Hello World";
+$md5_raw = md5($str, true);
+var_dump(bin2hex($md5_raw));
+
+$md5 = md5($str, false);
+
+if (strcmp(bin2hex($md5_raw), $md5) == 0 ) {
+ echo "TEST PASSED\n";
+} else {
+ echo "TEST FAILED\n";
+ var_dump($md5_raw, $md5);
+}
+
+?>
+===DONE===
+--EXPECT--
+*** Testing md5() : basic functionality - with raw output***
+string(32) "b10a8db164e0754105b7a99be72e3fe5"
+TEST PASSED
+===DONE===
\ No newline at end of file diff --git a/ext/standard/tests/strings/md5_error.phpt b/ext/standard/tests/strings/md5_error.phpt new file mode 100644 index 000000000..190b09c8e --- /dev/null +++ b/ext/standard/tests/strings/md5_error.phpt @@ -0,0 +1,35 @@ +--TEST--
+Test md5() function : error conditions
+--FILE--
+<?php
+/* Prototype : string md5 ( string $str [, bool $raw_output= false ] )
+ * Description: Calculate the md5 hash of a string
+ * Source code: ext/standard/md5.c
+*/
+
+echo "*** Testing md5() : error conditions ***\n";
+
+echo "\n-- Testing md5() function with no arguments --\n";
+var_dump( md5());
+
+echo "\n-- Testing md5() function with more than expected no. of arguments --\n";
+$str = "Hello World";
+$raw_output = true;
+$extra_arg = 10;
+
+var_dump(md5($str, $raw_output, $extra_arg));
+?>
+===DONE==
+--EXPECTF--
+*** Testing md5() : error conditions ***
+
+-- Testing md5() function with no arguments --
+
+Warning: md5() expects at least 1 parameter, 0 given in %s on line %d
+NULL
+
+-- Testing md5() function with more than expected no. of arguments --
+
+Warning: md5() expects at most 2 parameters, 3 given in %s on line %d
+NULL
+===DONE==
\ No newline at end of file diff --git a/ext/standard/tests/strings/money_format_basic1.phpt b/ext/standard/tests/strings/money_format_basic1.phpt index e76aa6087..70b5ca574 100644 --- a/ext/standard/tests/strings/money_format_basic1.phpt +++ b/ext/standard/tests/strings/money_format_basic1.phpt @@ -2,13 +2,9 @@ Test money_format() function : basic functionality using national currency symbols --SKIPIF-- <?php - if (!function_exists('money_format') || !function_exists('setlocale')) { + if (!function_exists('money_format')) { die("SKIP money_format - not supported\n"); } - - if (setlocale(LC_MONETARY, 'en_US') == false) { - die("SKIP en_US locale not available\n"); - } ?> --FILE-- <?php @@ -17,9 +13,11 @@ Test money_format() function : basic functionality using national currency symbo * Source code: ext/standard/string.c */ -echo "*** Testing money_format() : basic functionality using national currency symbols***\n"; +// =========================================================================================== +// = We do not test for exact return-values, as those might be different between OS-versions = +// =========================================================================================== -$original = setlocale(LC_MONETARY, 'en_US'); +echo "*** Testing money_format() : basic functionality***\n"; $value = 1234.5678; $negative_value = -1234.5678; @@ -28,57 +26,55 @@ $negative_value = -1234.5678; // left precision, 2 of right precision using national // format for en_US echo "Format values with 14 positions, 8 digits to left, 2 to right using national format\n"; -var_dump( money_format('%14#8.2n', $value)); -var_dump( money_format('%14#8.2n', $negative_value)); +echo gettype(money_format('%14#8.2n', $value))."\n"; +echo gettype(money_format('%14#8.2n', $negative_value))."\n"; // Same again but use '(' for negative values echo "Format again but with ( for negative values\n"; -var_dump( money_format('%(14#8.2n', $value)); -var_dump( money_format('%(14#8.2n', $negative_value)); +echo gettype(money_format('%(14#8.2n', $value))."\n"; +echo gettype(money_format('%(14#8.2n', $negative_value))."\n"; // Same again but use a '0' for padding character echo "Format with 0 for padding character\n"; -var_dump( money_format('%=014#8.2n', $value)); -var_dump( money_format('%=014#8.2n', $negative_value)); +echo gettype(money_format('%=014#8.2n', $value))."\n"; +echo gettype(money_format('%=014#8.2n', $negative_value))."\n"; // Same again but use a '*' for padding character echo "Format again with * for padding character\n"; -var_dump( money_format('%=*14#8.2n', $value)); -var_dump( money_format('%=*14#8.2n', $negative_value)); +echo gettype(money_format('%=*14#8.2n', $value))."\n"; +echo gettype(money_format('%=*14#8.2n', $negative_value))."\n"; // Same again but disable grouping character echo "Format again but disable grouping character\n"; -var_dump( money_format('%=*^14#8.2n', $value)); -var_dump( money_format('%=*^14#8.2n', $negative_value)); +echo gettype(money_format('%=*^14#8.2n', $value))."\n"; +echo gettype(money_format('%=*^14#8.2n', $negative_value))."\n"; // Same again but suppress currency symbol echo "Format again suppress currency symbol\n"; -var_dump( money_format('%=*!14#8.2n', $value)); -var_dump( money_format('%=*!14#8.2n', $negative_value)); - -setlocale(LC_MONETARY, $original); +echo gettype(money_format('%=*!14#8.2n', $value))."\n"; +echo gettype(money_format('%=*!14#8.2n', $negative_value))."\n"; ?> ===DONE=== --EXPECT-- -*** Testing money_format() : basic functionality using national currency symbols*** +*** Testing money_format() : basic functionality*** Format values with 14 positions, 8 digits to left, 2 to right using national format -string(15) " $ 1,234.57" -string(15) "-$ 1,234.57" +string +string Format again but with ( for negative values -string(15) " $ 1,234.57" -string(16) "($ 1,234.57)" +string +string Format with 0 for padding character -string(15) " $000001,234.57" -string(15) "-$000001,234.57" +string +string Format again with * for padding character -string(15) " $*****1,234.57" -string(15) "-$*****1,234.57" +string +string Format again but disable grouping character -string(14) " $****1234.57" -string(14) " -$****1234.57" +string +string Format again suppress currency symbol -string(14) " *****1,234.57" -string(14) "-*****1,234.57" +string +string ===DONE=== diff --git a/ext/standard/tests/strings/money_format_basic2.phpt b/ext/standard/tests/strings/money_format_basic2.phpt deleted file mode 100644 index 8074cf998..000000000 --- a/ext/standard/tests/strings/money_format_basic2.phpt +++ /dev/null @@ -1,84 +0,0 @@ ---TEST-- -Test money_format() function : basic functionality using international currency symbols ---SKIPIF-- -<?php - if (!function_exists('money_format') || !function_exists('setlocale')) { - die("SKIP money_format - not supported\n"); - } - - if (setlocale(LC_MONETARY, 'en_US') == false) { - die("SKIP en_US locale not available\n"); - } -?> ---FILE-- -<?php -/* Prototype : string money_format ( string $format , float $number ) - * Description: Formats a number as a currency string - * Source code: ext/standard/string.c -*/ - -echo "*** Testing money_format() : basic functionality using international currency symbols***\n"; - -$original = setlocale(LC_MONETARY, 'en_US'); - -$value = 1234.5678; -$negative_value = -1234.5678; - -// Format with 14 positions of width, 8 digits of -// left precision, 2 of right precision using national -// format for en_US -echo "Format with 14 positions, 8 digits to left, 2 to right using national format\n"; -var_dump( money_format('%14#8.2i', $value)); -var_dump( money_format('%14#8.2i', $negative_value)); - -// Same again but use '(' for negative values -echo "Format with ( for negative values\n"; -var_dump( money_format('%(14#8.2i', $value)); -var_dump( money_format('%(14#8.2i', $negative_value)); - -// Same again but use a '0' for padding character -echo "Format with 0 for padding character\n"; -var_dump( money_format('%=014#8.2i', $value)); -var_dump( money_format('%=014#8.2i', $negative_value)); - -// Same again but use a '*' for padding character -echo "Format with * for padding character\n"; -var_dump( money_format('%=*14#8.2i', $value)); -var_dump( money_format('%=*14#8.2i', $negative_value)); - -// Same again but disable grouping character -echo "Format again but disable grouping character\n"; -var_dump( money_format('%=*^14#8.2i', $value)); -var_dump( money_format('%=*^14#8.2i', $negative_value)); - -// Same again but suppress currency symbol -echo "Format again but suppress currency symbol\n"; -var_dump( money_format('%=*!14#8.2i', $value)); -var_dump( money_format('%=*!14#8.2i', $negative_value)); - -setlocale(LC_MONETARY, $original); - -?> -===DONE=== ---EXPECT-- -*** Testing money_format() : basic functionality using international currency symbols*** -Format with 14 positions, 8 digits to left, 2 to right using national format -string(18) " USD 1,234.57" -string(18) "-USD 1,234.57" -Format with ( for negative values -string(18) " USD 1,234.57" -string(19) "(USD 1,234.57)" -Format with 0 for padding character -string(18) " USD 000001,234.57" -string(18) "-USD 000001,234.57" -Format with * for padding character -string(18) " USD *****1,234.57" -string(18) "-USD *****1,234.57" -Format again but disable grouping character -string(16) " USD ****1234.57" -string(16) "-USD ****1234.57" -Format again but suppress currency symbol -string(14) " *****1,234.57" -string(14) "-*****1,234.57" -===DONE=== - diff --git a/ext/standard/tests/strings/money_format_basic3.phpt b/ext/standard/tests/strings/money_format_basic3.phpt deleted file mode 100644 index 98d0fca7f..000000000 --- a/ext/standard/tests/strings/money_format_basic3.phpt +++ /dev/null @@ -1,83 +0,0 @@ ---TEST-- -Test money_format() function : basic functionality using national currency symbols and de_DE locale ---SKIPIF-- -<?php - if (!function_exists('money_format') || !function_exists('setlocale')) { - die("SKIP money_format - not supported\n"); - } - - if (setlocale(LC_MONETARY, 'de_DE') == false) { - die("SKIP de_DE locale not available\n"); - } -?> ---FILE-- -<?php -/* Prototype : string money_format ( string $format , float $number ) - * Description: Formats a number as a currency string - * Source code: ext/standard/string.c -*/ - -echo "*** Testing money_format() : basic functionality using national currency symbols and de_DE locale***\n"; - -$original = setlocale(LC_MONETARY, 'de_DE'); - -$value = 1234.5678; -$negative_value = -1234.5678; - -// Format with 14 positions of width, 8 digits of -// left precision, 2 of right precision using national -// format for en_US -echo "Format values with 14 positions, 8 digits to left, 2 to right using national format\n"; -var_dump( money_format('%14#8.2n', $value)); -var_dump( money_format('%14#8.2n', $negative_value)); - -// Same again but use '(' for negative values -echo "Format again but with ( for negative values\n"; -var_dump( money_format('%(14#8.2n', $value)); -var_dump( money_format('%(14#8.2n', $negative_value)); - -// Same again but use a '0' for padding character -echo "Format with 0 for padding character\n"; -var_dump( money_format('%=014#8.2n', $value)); -var_dump( money_format('%=014#8.2n', $negative_value)); - -// Same again but use a '*' for padding character -echo "Format again with * for padding character\n"; -var_dump( money_format('%=*14#8.2n', $value)); -var_dump( money_format('%=*14#8.2n', $negative_value)); - -// Same again but disable grouping character -echo "Format again but disable grouping character\n"; -var_dump( money_format('%=*^14#8.2n', $value)); -var_dump( money_format('%=*^14#8.2n', $negative_value)); - -// Same again but suppress currency symbol -echo "Format again suppress currency symbol\n"; -var_dump( money_format('%=*!14#8.2n', $value)); -var_dump( money_format('%=*!14#8.2n', $negative_value)); - -setlocale(LC_MONETARY, $original); - -?> -===DONE=== ---EXPECT-- -*** Testing money_format() : basic functionality using national currency symbols and de_DE locale*** -Format values with 14 positions, 8 digits to left, 2 to right using national format -string(18) " 1.234,57 EUR" -string(18) "- 1.234,57 EUR" -Format again but with ( for negative values -string(18) " 1.234,57 EUR" -string(19) "( 1.234,57 EUR)" -Format with 0 for padding character -string(18) " 000001.234,57 EUR" -string(18) "-000001.234,57 EUR" -Format again with * for padding character -string(18) " *****1.234,57 EUR" -string(18) "-*****1.234,57 EUR" -Format again but disable grouping character -string(16) " ****1234,57 EUR" -string(16) "-****1234,57 EUR" -Format again suppress currency symbol -string(14) " *****1.234,57" -string(14) "-*****1.234,57" -===DONE=== diff --git a/ext/standard/tests/strings/money_format_error.phpt b/ext/standard/tests/strings/money_format_error.phpt index fac89d1b5..cf110b43a 100644 --- a/ext/standard/tests/strings/money_format_error.phpt +++ b/ext/standard/tests/strings/money_format_error.phpt @@ -13,6 +13,10 @@ Test money_format() function : error conditions * Source code: ext/standard/string.c */ +// =========================================================================================== +// = We do not test for exact return-values, as those might be different between OS-versions = +// =========================================================================================== + $string = '%14#8.2n'; $value = 1234.56; $extra_arg = 10; diff --git a/ext/standard/tests/strings/money_format_variation1.phpt b/ext/standard/tests/strings/money_format_variation1.phpt index 7f2084355..d4fa687db 100644 --- a/ext/standard/tests/strings/money_format_variation1.phpt +++ b/ext/standard/tests/strings/money_format_variation1.phpt @@ -2,13 +2,9 @@ Test money_format() function : usage variations - test values for $format argument --SKIPIF-- <?php - if (!function_exists('money_format') || !function_exists('setlocale')) { + if (!function_exists('money_format')) { die("SKIP money_format - not supported\n"); } - - if (setlocale(LC_MONETARY, 'de_DE') == false) { - die("SKIP de_DE locale not available\n"); - } ?> --FILE-- <?php @@ -17,8 +13,9 @@ Test money_format() function : usage variations - test values for $format argum * Source code: ext/standard/string.c */ -$original = setlocale(LC_MONETARY, 'en_US'); - +// =========================================================================================== +// = We do not test for exact return-values, as those might be different between OS-versions = +// =========================================================================================== echo "*** Testing money_format() function: with unexpected inputs for 'format' argument ***\n"; @@ -97,38 +94,35 @@ $value = 1234.56; foreach($formats as $format) { echo "-- Iteration $count --\n"; - var_dump( money_format($format, $value) ); + echo gettype(money_format($format, $value))."\n"; $count ++; } // close the file handle fclose($file_handle); -// restore original locale -setlocale(LC_MONETARY, $original); - ?> ===Done=== --EXPECTF-- *** Testing money_format() function: with unexpected inputs for 'format' argument *** -- Iteration 1 -- -string(1) "0" +string -- Iteration 2 -- -string(1) "1" +string -- Iteration 3 -- -string(3) "255" +string -- Iteration 4 -- -string(3) "256" +string -- Iteration 5 -- -string(10) "2147483647" +string -- Iteration 6 -- -string(11) "-2147483648" +string -- Iteration 7 -- -string(4) "10.5" +string -- Iteration 8 -- -string(5) "-20.5" +string -- Iteration 9 -- -string(12) "101234567000" +string -- Iteration 10 -- Warning: money_format() expects parameter 1 to be string, array given in %s on line %d @@ -142,37 +136,37 @@ NULL Warning: money_format() expects parameter 1 to be string, array given in %s on line %d NULL -- Iteration 13 -- -string(1) "1" +string -- Iteration 14 -- -string(0) "" +string -- Iteration 15 -- -string(1) "1" +string -- Iteration 16 -- -string(0) "" +string -- Iteration 17 -- -string(0) "" +string -- Iteration 18 -- -string(0) "" +string -- Iteration 19 -- -string(4) "abcd" +string -- Iteration 20 -- -string(4) "abcd" +string -- Iteration 21 -- -string(5) "0x12f" +string -- Iteration 22 -- -string(18) " *****1,234.56abcd" +string -- Iteration 23 -- Warning: money_format() expects parameter 1 to be string, object given in %s on line %d NULL -- Iteration 24 -- -string(17) " sample object " +string -- Iteration 25 -- Warning: money_format() expects parameter 1 to be string, resource given in %s on line %d NULL -- Iteration 26 -- -string(0) "" +string -- Iteration 27 -- -string(0) "" +string ===Done=== diff --git a/ext/standard/tests/strings/money_format_variation2.phpt b/ext/standard/tests/strings/money_format_variation2.phpt index d3cb523a6..8ac4cb9a9 100644 --- a/ext/standard/tests/strings/money_format_variation2.phpt +++ b/ext/standard/tests/strings/money_format_variation2.phpt @@ -2,13 +2,9 @@ Test money_format() function : usage variations - test values for $number argument --SKIPIF-- <?php - if (!function_exists('money_format') || !function_exists('setlocale')) { + if (!function_exists('money_format')) { die("SKIP money_format - not supported\n"); } - - if (setlocale(LC_MONETARY, 'de_DE') == false) { - die("SKIP de_DE locale not available\n"); - } ?> --FILE-- <?php @@ -17,8 +13,9 @@ Test money_format() function : usage variations - test values for $number argum * Source code: ext/standard/string.c */ -$original = setlocale(LC_MONETARY, 'en_US'); - +// =========================================================================================== +// = We do not test for exact return-values, as those might be different between OS-versions = +// =========================================================================================== echo "*** Testing money_format() function: with unexpected inputs for 'number' argument ***\n"; @@ -97,38 +94,35 @@ $format = '%14#8.2i'; foreach($numbers as $number) { echo "-- Iteration $count --\n"; - var_dump( money_format($format, $number) ); + echo gettype(money_format($format, $number))."\n"; $count ++; } // close the file handle -fclose($file_handle); - -// restore original locale -setlocale(LC_MONETARY, $original); +fclose($file_handle); ?> ===Done=== --EXPECTF-- *** Testing money_format() function: with unexpected inputs for 'number' argument *** -- Iteration 1 -- -string(18) " USD 0.00" +string -- Iteration 2 -- -string(18) " USD 1.00" +string -- Iteration 3 -- -string(18) " USD 255.00" +string -- Iteration 4 -- -string(18) " USD 256.00" +string -- Iteration 5 -- -string(21) " USD 2,147,483,647.00" +string -- Iteration 6 -- -string(21) "-USD 2,147,483,648.00" +string -- Iteration 7 -- -string(18) " USD 10.50" +string -- Iteration 8 -- -string(18) "-USD 20.50" +string -- Iteration 9 -- -string(23) " USD 101,234,567,000.00" +string -- Iteration 10 -- Warning: money_format() expects parameter 2 to be double, array given in %s on line %d @@ -142,17 +136,17 @@ NULL Warning: money_format() expects parameter 2 to be double, array given in %s on line %d NULL -- Iteration 13 -- -string(18) " USD 1.00" +string -- Iteration 14 -- -string(18) " USD 0.00" +string -- Iteration 15 -- -string(18) " USD 1.00" +string -- Iteration 16 -- -string(18) " USD 0.00" +string -- Iteration 17 -- -string(18) " USD 0.00" +string -- Iteration 18 -- -string(18) " USD 0.00" +string -- Iteration 19 -- Warning: money_format() expects parameter 2 to be double, string given in %s on line %d @@ -162,7 +156,7 @@ NULL Warning: money_format() expects parameter 2 to be double, string given in %s on line %d NULL -- Iteration 21 -- -string(18) " USD 303.00" +string -- Iteration 22 -- Warning: money_format() expects parameter 2 to be double, string given in %s on line %d @@ -180,7 +174,7 @@ NULL Warning: money_format() expects parameter 2 to be double, resource given in %s on line %d NULL -- Iteration 26 -- -string(18) " USD 0.00" +string -- Iteration 27 -- -string(18) " USD 0.00" +string ===Done=== diff --git a/ext/standard/tests/strings/parse_str_basic3.phpt b/ext/standard/tests/strings/parse_str_basic3.phpt index a600fe01e..5b0641e14 100644 --- a/ext/standard/tests/strings/parse_str_basic3.phpt +++ b/ext/standard/tests/strings/parse_str_basic3.phpt @@ -1,11 +1,14 @@ --TEST-- Test parse_str() function : basic functionality +--INI-- +magic_quotes_gpc = on --FILE-- <?php /* Prototype : void parse_str ( string $str [, array &$arr ] ) * Description: Parses the string into variables * Source code: ext/standard/string.c */ + echo "*** Testing parse_str() : basic functionality ***\n"; echo "\nTest string with array values\n"; @@ -88,6 +91,7 @@ var_dump($res); ?> ===DONE=== --EXPECTF-- +PHP Warning: Directive 'magic_quotes_gpc' is deprecated in PHP 5.3 and greater in Unknown on line 0 *** Testing parse_str() : basic functionality *** Test string with array values @@ -263,4 +267,4 @@ array(1) { } } } -===DONE===
\ No newline at end of file +===DONE=== diff --git a/ext/standard/tests/strings/parse_str_basic4.phpt b/ext/standard/tests/strings/parse_str_basic4.phpt index 0e4baf8d7..894dbf0c2 100644 --- a/ext/standard/tests/strings/parse_str_basic4.phpt +++ b/ext/standard/tests/strings/parse_str_basic4.phpt @@ -20,6 +20,11 @@ $str = "arr[one=sid&arr[4][two=fred"; var_dump(parse_str($str, $res)); var_dump($res); +echo "\nTest string with badly formed % numbers\n"; +$str = "first=%41&second=%a&third=%b"; +var_dump(parse_str($str)); +var_dump($first, $second, $third); + echo "\nTest string with non-binary safe name\n"; $str = "arr.test[1]=sid&arr test[4][two]=fred"; var_dump(parse_str($str, $res)); @@ -59,6 +64,12 @@ array(2) { } } +Test string with badly formed % numbers +NULL +string(1) "A" +string(2) "%a" +string(2) "%b" + Test string with non-binary safe name NULL array(1) { diff --git a/ext/standard/tests/strings/show_source_basic.phpt b/ext/standard/tests/strings/show_source_basic.phpt new file mode 100644 index 000000000..cfd998fe9 --- /dev/null +++ b/ext/standard/tests/strings/show_source_basic.phpt @@ -0,0 +1,27 @@ +--TEST-- +Test function show_source() by calling it with its expected arguments, more test for highlight_file() +--CREDITS-- +Francesco Fullone ff@ideato.it +#PHPTestFest Cesena Italia on 2009-06-20 +--FILE-- +<?php +echo "*** Test by calling method or function with its expected arguments ***\n"; +$foo = 'bar'; +$baz = "something ".$foo."\n"; + +if ( $foo == 'bar' ) +{ + $baz = 'baz'; +} + + /* some code here */ + +show_source(__FILE__); + +?> +--EXPECTF-- +*** Test by calling method or function with its expected arguments *** +<code><span style="color: #000000"> +<span style="color: #0000BB"><?php<br /></span><span style="color: #007700">echo </span><span style="color: #DD0000">"*** Test by calling method or function with its expected arguments ***\n"</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">$foo </span><span style="color: #007700">= </span><span style="color: #DD0000">'bar'</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">$baz </span><span style="color: #007700">= </span><span style="color: #DD0000">"something "</span><span style="color: #007700">.</span><span style="color: #0000BB">$foo</span><span style="color: #007700">.</span><span style="color: #DD0000">"\n"</span><span style="color: #007700">;<br /><br />if ( </span><span style="color: #0000BB">$foo </span><span style="color: #007700">== </span><span style="color: #DD0000">'bar' </span><span style="color: #007700">) <br />{<br /> </span><span style="color: #0000BB">$baz </span><span style="color: #007700">= </span><span style="color: #DD0000">'baz'</span><span style="color: #007700">;<br />}<br /><br /> </span><span style="color: #FF8000">/* some code here */<br /> <br /></span><span style="color: #0000BB">show_source</span><span style="color: #007700">(</span><span style="color: #0000BB">__FILE__</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">?><br /></span> +</span> +</code> diff --git a/ext/standard/tests/strings/show_source_variation1.phpt b/ext/standard/tests/strings/show_source_variation1.phpt new file mode 100644 index 000000000..a9993ed45 --- /dev/null +++ b/ext/standard/tests/strings/show_source_variation1.phpt @@ -0,0 +1,28 @@ +--TEST-- +Test function show_source() by calling it with its expected arguments and php output, more test for highlight_file() +--CREDITS-- +Francesco Fullone ff@ideato.it +#PHPTestFest Cesena Italia on 2009-06-20 +--FILE-- +<?php +echo "*** Test by calling method or function with its expected arguments and php output ***\n"; +$foo = 'bar'; +$baz = "something ".$foo."\n"; + +if ( $foo == 'bar' ) +{ + $baz = "baz\n"; +} + + /* some code here */ +echo $baz; +show_source(__FILE__); +echo $foo; +?> +--EXPECTF-- +*** Test by calling method or function with its expected arguments and php output *** +baz +<code><span style="color: #000000"> +<span style="color: #0000BB"><?php<br /></span><span style="color: #007700">echo </span><span style="color: #DD0000">"*** Test by calling method or function with its expected arguments and php output ***\n"</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">$foo </span><span style="color: #007700">= </span><span style="color: #DD0000">'bar'</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">$baz </span><span style="color: #007700">= </span><span style="color: #DD0000">"something "</span><span style="color: #007700">.</span><span style="color: #0000BB">$foo</span><span style="color: #007700">.</span><span style="color: #DD0000">"\n"</span><span style="color: #007700">;<br /><br />if ( </span><span style="color: #0000BB">$foo </span><span style="color: #007700">== </span><span style="color: #DD0000">'bar' </span><span style="color: #007700">) <br />{<br /> </span><span style="color: #0000BB">$baz </span><span style="color: #007700">= </span><span style="color: #DD0000">"baz\n"</span><span style="color: #007700">;<br />}<br /><br /> </span><span style="color: #FF8000">/* some code here */<br /></span><span style="color: #007700">echo </span><span style="color: #0000BB">$baz</span><span style="color: #007700">; <br /></span><span style="color: #0000BB">show_source</span><span style="color: #007700">(</span><span style="color: #0000BB">__FILE__</span><span style="color: #007700">);<br />echo </span><span style="color: #0000BB">$foo</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">?><br /></span> +</span> +</code>bar diff --git a/ext/standard/tests/strings/show_source_variation2.phpt b/ext/standard/tests/strings/show_source_variation2.phpt new file mode 100644 index 000000000..06ef66c2d --- /dev/null +++ b/ext/standard/tests/strings/show_source_variation2.phpt @@ -0,0 +1,27 @@ +--TEST-- +Test function show_source() by calling it with its expected arguments and output to variable, more test for highlight_file() +--CREDITS-- +Francesco Fullone ff@ideato.it +#PHPTestFest Cesena Italia on 2009-06-20 +--FILE-- +<?php +echo "*** Test by calling method or function with its expected arguments and output to variable ***\n"; +$foo = 'bar'; +$baz = "something ".$foo."\n"; + +if ( $foo == 'bar' ) +{ + $baz = "baz\n"; +} + + /* some code here */ +$source = show_source(__FILE__, true); + +var_dump($source); +?> +--EXPECTF-- +*** Test by calling method or function with its expected arguments and output to variable *** +string(1987) "<code><span style="color: #000000"> +<span style="color: #0000BB"><?php<br /></span><span style="color: #007700">echo </span><span style="color: #DD0000">"*** Test by calling method or function with its expected arguments and output to variable ***\n"</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">$foo </span><span style="color: #007700">= </span><span style="color: #DD0000">'bar'</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">$baz </span><span style="color: #007700">= </span><span style="color: #DD0000">"something "</span><span style="color: #007700">.</span><span style="color: #0000BB">$foo</span><span style="color: #007700">.</span><span style="color: #DD0000">"\n"</span><span style="color: #007700">;<br /><br />if ( </span><span style="color: #0000BB">$foo </span><span style="color: #007700">== </span><span style="color: #DD0000">'bar' </span><span style="color: #007700">) <br />{<br /> </span><span style="color: #0000BB">$baz </span><span style="color: #007700">= </span><span style="color: #DD0000">"baz\n"</span><span style="color: #007700">;<br />}<br /><br /> </span><span style="color: #FF8000">/* some code here */ <br /></span><span style="color: #0000BB">$source </span><span style="color: #007700">= </span><span style="color: #0000BB">show_source</span><span style="color: #007700">(</span><span style="color: #0000BB">__FILE__</span><span style="color: #007700">, </span><span style="color: #0000BB">true</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$source</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?><br /></span> +</span> +</code>" diff --git a/ext/standard/tests/strings/soundex_basic.phpt b/ext/standard/tests/strings/soundex_basic.phpt new file mode 100644 index 000000000..65bcb6425 --- /dev/null +++ b/ext/standard/tests/strings/soundex_basic.phpt @@ -0,0 +1,46 @@ +--TEST--
+Test soundex() function : basic functionality
+--FILE--
+<?php
+/* Prototype : string soundex ( string $str )
+ * Description: Calculate the soundex key of a string
+ * Source code: ext/standard/string.c
+*/
+echo "*** Testing soundex() : basic functionality ***\n";
+
+var_dump(soundex("Euler"));
+var_dump(soundex("Gauss"));
+var_dump(soundex("Hilbert"));
+var_dump(soundex("Knuth"));
+var_dump(soundex("Lloyd"));
+var_dump(soundex("Lukasiewicz"));
+
+var_dump(soundex("Euler") == soundex("Ellery")); // E460
+var_dump(soundex("Gauss") == soundex("Ghosh")); // G200
+var_dump(soundex("Hilbert") == soundex("Heilbronn")); // H416
+var_dump(soundex("Knuth") == soundex("Kant")); // K530
+var_dump(soundex("Lloyd") == soundex("Ladd")); // L300
+var_dump(soundex("Lukasiewicz") == soundex("Lissajous")); // L222
+
+var_dump(soundex("Lukasiewicz") == soundex("Ghosh"));
+var_dump(soundex("Hilbert") == soundex("Ladd"));
+?>
+===DONE===
+--EXPECT--
+*** Testing soundex() : basic functionality ***
+string(4) "E460"
+string(4) "G200"
+string(4) "H416"
+string(4) "K530"
+string(4) "L300"
+string(4) "L222"
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(false)
+bool(false)
+
+===DONE===
diff --git a/ext/standard/tests/strings/soundex_error.phpt b/ext/standard/tests/strings/soundex_error.phpt new file mode 100644 index 000000000..a81b9d24f --- /dev/null +++ b/ext/standard/tests/strings/soundex_error.phpt @@ -0,0 +1,34 @@ +--TEST--
+Test soundex() function : error conditions
+--FILE--
+<?php
+/* Prototype : string soundex ( string $str )
+ * Description: Calculate the soundex key of a string
+ * Source code: ext/standard/string.c
+*/
+
+echo "\n*** Testing soundex error conditions ***";
+
+echo "-- Testing soundex() function with Zero arguments --\n";
+var_dump( soundex() );
+
+echo "\n\n-- Testing soundex() function with more than expected no. of arguments --\n";
+$str = "Euler";
+$extra_arg = 10;
+var_dump( soundex( $str, $extra_arg) );
+
+?>
+===DONE===
+--EXPECTF--
+*** Testing soundex error conditions ***-- Testing soundex() function with Zero arguments --
+
+Warning: soundex() expects exactly 1 parameter, 0 given in %s on line %d
+NULL
+
+
+-- Testing soundex() function with more than expected no. of arguments --
+
+Warning: soundex() expects exactly 1 parameter, 2 given in %s on line %d
+NULL
+
+===DONE===
\ No newline at end of file diff --git a/ext/standard/tests/strings/str_replace_basic.phpt b/ext/standard/tests/strings/str_replace_basic.phpt new file mode 100644 index 000000000..10bf54234 --- /dev/null +++ b/ext/standard/tests/strings/str_replace_basic.phpt @@ -0,0 +1,49 @@ +--TEST-- +Test str_replace() function basic function +--INI-- +precision=14 +--FILE-- +<?php +/* + Prototype: mixed str_replace(mixed $search, mixed $replace, + mixed $subject [, int &$count]); + Description: Replace all occurrences of the search string with + the replacement string +*/ + +echo "\n*** Testing str_replace() on basic operations ***\n"; + +var_dump( str_replace("", "", "") ); + +var_dump( str_replace("e", "b", "test") ); + +var_dump( str_replace("", "", "", $count) ); +var_dump( $count ); + +var_dump( str_replace("q", "q", "q", $count) ); +var_dump( $count ); + +var_dump( str_replace("long string here", "", "", $count) ); +var_dump( $count ); + +$fp = fopen( __FILE__, "r" ); +$fp_copy = $fp; +var_dump( str_replace($fp_copy, $fp_copy, $fp_copy, $fp_copy) ); +var_dump( $fp_copy ); +fclose($fp); + +?> +===DONE=== +--EXPECTF-- +*** Testing str_replace() on basic operations *** +string(0) "" +string(4) "tbst" +string(0) "" +int(0) +string(1) "q" +int(1) +string(0) "" +int(0) +string(%d) "Resource id #%d" +int(1) +===DONE=== diff --git a/ext/standard/tests/strings/str_replace_error.phpt b/ext/standard/tests/strings/str_replace_error.phpt new file mode 100644 index 000000000..9fafc57a3 --- /dev/null +++ b/ext/standard/tests/strings/str_replace_error.phpt @@ -0,0 +1,41 @@ +--TEST-- +Test str_replace() function error conditions +--INI-- +precision=14 +--FILE-- +<?php +/* + Prototype: mixed str_replace(mixed $search, mixed $replace, + mixed $subject [, int &$count]); + Description: Replace all occurrences of the search string with + the replacement string +*/ + + +echo "\n*** Testing str_replace error conditions ***"; +/* Invalid arguments */ +var_dump( str_replace() ); +var_dump( str_replace("") ); +var_dump( str_replace(NULL) ); +var_dump( str_replace(1, 2) ); +var_dump( str_replace(1,2,3,$var,5) ); + +?> +===DONE=== +--EXPECTF-- +*** Testing str_replace error conditions *** +Warning: str_replace() expects at least 3 parameters, 0 given in %sstr_replace_error.php on line 12 +NULL + +Warning: str_replace() expects at least 3 parameters, 1 given in %sstr_replace_error.php on line 13 +NULL + +Warning: str_replace() expects at least 3 parameters, 1 given in %sstr_replace_error.php on line 14 +NULL + +Warning: str_replace() expects at least 3 parameters, 2 given in %sstr_replace_error.php on line 15 +NULL + +Warning: str_replace() expects at most 4 parameters, 5 given in %sstr_replace_error.php on line 16 +NULL +===DONE===
\ No newline at end of file diff --git a/ext/standard/tests/strings/str_replace_variation1.phpt b/ext/standard/tests/strings/str_replace_variation1.phpt new file mode 100644 index 000000000..279fb2201 --- /dev/null +++ b/ext/standard/tests/strings/str_replace_variation1.phpt @@ -0,0 +1,392 @@ +--TEST-- +Test str_replace() function - test search values +--INI-- +precision=14 +--FILE-- +<?php +/* + Prototype: mixed str_replace(mixed $search, mixed $replace, + mixed $subject [, int &$count]); + Description: Replace all occurrences of the search string with + the replacement string +*/ + + +echo "\n*** Testing str_replace() with various search values ***"; +$search_arr = array( TRUE, FALSE, 1, 0, -1, "1", "0", "-1", NULL, + array(), "php", ""); + +$i = 0; +/* loop through to replace the matched elements in the array */ +foreach( $search_arr as $value ) { + echo "\n-- Iteration $i --\n"; + /* replace the string in array */ + var_dump( str_replace($value, "FOUND", $search_arr, $count) ); + var_dump( $count ); + $i++; +} + +?> +===DONE=== +--EXPECT-- +*** Testing str_replace() with various search values *** +-- Iteration 0 -- +array(12) { + [0]=> + string(5) "FOUND" + [1]=> + string(0) "" + [2]=> + string(5) "FOUND" + [3]=> + string(1) "0" + [4]=> + string(6) "-FOUND" + [5]=> + string(5) "FOUND" + [6]=> + string(1) "0" + [7]=> + string(6) "-FOUND" + [8]=> + string(0) "" + [9]=> + array(0) { + } + [10]=> + string(3) "php" + [11]=> + string(0) "" +} +int(5) + +-- Iteration 1 -- +array(12) { + [0]=> + string(1) "1" + [1]=> + string(0) "" + [2]=> + string(1) "1" + [3]=> + string(1) "0" + [4]=> + string(2) "-1" + [5]=> + string(1) "1" + [6]=> + string(1) "0" + [7]=> + string(2) "-1" + [8]=> + string(0) "" + [9]=> + array(0) { + } + [10]=> + string(3) "php" + [11]=> + string(0) "" +} +int(0) + +-- Iteration 2 -- +array(12) { + [0]=> + string(5) "FOUND" + [1]=> + string(0) "" + [2]=> + string(5) "FOUND" + [3]=> + string(1) "0" + [4]=> + string(6) "-FOUND" + [5]=> + string(5) "FOUND" + [6]=> + string(1) "0" + [7]=> + string(6) "-FOUND" + [8]=> + string(0) "" + [9]=> + array(0) { + } + [10]=> + string(3) "php" + [11]=> + string(0) "" +} +int(5) + +-- Iteration 3 -- +array(12) { + [0]=> + string(1) "1" + [1]=> + string(0) "" + [2]=> + string(1) "1" + [3]=> + string(5) "FOUND" + [4]=> + string(2) "-1" + [5]=> + string(1) "1" + [6]=> + string(5) "FOUND" + [7]=> + string(2) "-1" + [8]=> + string(0) "" + [9]=> + array(0) { + } + [10]=> + string(3) "php" + [11]=> + string(0) "" +} +int(2) + +-- Iteration 4 -- +array(12) { + [0]=> + string(1) "1" + [1]=> + string(0) "" + [2]=> + string(1) "1" + [3]=> + string(1) "0" + [4]=> + string(5) "FOUND" + [5]=> + string(1) "1" + [6]=> + string(1) "0" + [7]=> + string(5) "FOUND" + [8]=> + string(0) "" + [9]=> + array(0) { + } + [10]=> + string(3) "php" + [11]=> + string(0) "" +} +int(2) + +-- Iteration 5 -- +array(12) { + [0]=> + string(5) "FOUND" + [1]=> + string(0) "" + [2]=> + string(5) "FOUND" + [3]=> + string(1) "0" + [4]=> + string(6) "-FOUND" + [5]=> + string(5) "FOUND" + [6]=> + string(1) "0" + [7]=> + string(6) "-FOUND" + [8]=> + string(0) "" + [9]=> + array(0) { + } + [10]=> + string(3) "php" + [11]=> + string(0) "" +} +int(5) + +-- Iteration 6 -- +array(12) { + [0]=> + string(1) "1" + [1]=> + string(0) "" + [2]=> + string(1) "1" + [3]=> + string(5) "FOUND" + [4]=> + string(2) "-1" + [5]=> + string(1) "1" + [6]=> + string(5) "FOUND" + [7]=> + string(2) "-1" + [8]=> + string(0) "" + [9]=> + array(0) { + } + [10]=> + string(3) "php" + [11]=> + string(0) "" +} +int(2) + +-- Iteration 7 -- +array(12) { + [0]=> + string(1) "1" + [1]=> + string(0) "" + [2]=> + string(1) "1" + [3]=> + string(1) "0" + [4]=> + string(5) "FOUND" + [5]=> + string(1) "1" + [6]=> + string(1) "0" + [7]=> + string(5) "FOUND" + [8]=> + string(0) "" + [9]=> + array(0) { + } + [10]=> + string(3) "php" + [11]=> + string(0) "" +} +int(2) + +-- Iteration 8 -- +array(12) { + [0]=> + string(1) "1" + [1]=> + string(0) "" + [2]=> + string(1) "1" + [3]=> + string(1) "0" + [4]=> + string(2) "-1" + [5]=> + string(1) "1" + [6]=> + string(1) "0" + [7]=> + string(2) "-1" + [8]=> + string(0) "" + [9]=> + array(0) { + } + [10]=> + string(3) "php" + [11]=> + string(0) "" +} +int(0) + +-- Iteration 9 -- +array(12) { + [0]=> + string(1) "1" + [1]=> + string(0) "" + [2]=> + string(1) "1" + [3]=> + string(1) "0" + [4]=> + string(2) "-1" + [5]=> + string(1) "1" + [6]=> + string(1) "0" + [7]=> + string(2) "-1" + [8]=> + string(0) "" + [9]=> + array(0) { + } + [10]=> + string(3) "php" + [11]=> + string(0) "" +} +int(0) + +-- Iteration 10 -- +array(12) { + [0]=> + string(1) "1" + [1]=> + string(0) "" + [2]=> + string(1) "1" + [3]=> + string(1) "0" + [4]=> + string(2) "-1" + [5]=> + string(1) "1" + [6]=> + string(1) "0" + [7]=> + string(2) "-1" + [8]=> + string(0) "" + [9]=> + array(0) { + } + [10]=> + string(5) "FOUND" + [11]=> + string(0) "" +} +int(1) + +-- Iteration 11 -- +array(12) { + [0]=> + string(1) "1" + [1]=> + string(0) "" + [2]=> + string(1) "1" + [3]=> + string(1) "0" + [4]=> + string(2) "-1" + [5]=> + string(1) "1" + [6]=> + string(1) "0" + [7]=> + string(2) "-1" + [8]=> + string(0) "" + [9]=> + array(0) { + } + [10]=> + string(3) "php" + [11]=> + string(0) "" +} +int(0) +===DONE=== diff --git a/ext/standard/tests/strings/str_replace_variation2.phpt b/ext/standard/tests/strings/str_replace_variation2.phpt Binary files differnew file mode 100644 index 000000000..5534341dc --- /dev/null +++ b/ext/standard/tests/strings/str_replace_variation2.phpt diff --git a/ext/standard/tests/strings/str_replace_variation3.phpt b/ext/standard/tests/strings/str_replace_variation3.phpt new file mode 100644 index 000000000..9b19153fa --- /dev/null +++ b/ext/standard/tests/strings/str_replace_variation3.phpt @@ -0,0 +1,227 @@ +--TEST-- +Test str_replace() function +--INI-- +precision=14 +--FILE-- +<?php +/* + Prototype: mixed str_replace(mixed $search, mixed $replace, + mixed $subject [, int &$count]); + Description: Replace all occurrences of the search string with + the replacement string +*/ + + +echo "\n*** Testing Miscelleneous input data ***\n"; +/* If replace has fewer values than search, then an empty + string is used for the rest of replacement values */ +var_dump( str_replace(array("a", "a", "b"), + array("q", "q"), + "aaabb", $count + ) + ); +var_dump($count); +var_dump( str_replace(array("a", "a", "b"), + array("q", "q"), + array("aaa", "bbb", "ccc"), + $count + ) + ); +var_dump($count); + + +echo "\n-- Testing objects --\n"; +/* we get "Catchable fatal error: saying Object of class could not be converted + to string" by default, when an object is passed instead of string: +The error can be avoided by chosing the __toString magix method as follows: */ + +class subject +{ + function __toString() { + return "Hello, world"; + } +} +$obj_subject = new subject; + +class search +{ + function __toString() { + return "Hello, world"; + } +} +$obj_search = new search; + +class replace +{ + function __toString() { + return "Hello, world"; + } +} +$obj_replace = new replace; + +var_dump(str_replace("$obj_search", "$obj_replace", "$obj_subject", $count)); +var_dump($count); + + +echo "\n-- Testing arrays --\n"; +var_dump(str_replace(array("a", "a", "b"), "multi", "aaa", $count)); +var_dump($count); + +var_dump(str_replace( array("a", "a", "b"), + array("q", "q", "c"), + "aaa", $count + ) +); +var_dump($count); + +var_dump(str_replace( array("a", "a", "b"), + array("q", "q", "c"), + array("aaa", "bbb"), + $count + ) +); +var_dump($count); + +var_dump(str_replace("a", array("q", "q", "c"), array("aaa"), $count)); +var_dump($count); + +var_dump(str_replace("a", 1, array("aaa", "bbb"), $count)); +var_dump($count); + +var_dump(str_replace(1, 3, array("aaa1", "2bbb"), $count)); +var_dump($count); + + +echo "\n-- Testing Resources --\n"; +$resource1 = fopen( __FILE__, "r" ); +$resource2 = opendir( "." ); +var_dump(str_replace("stream", "FOUND", $resource1, $count)); +var_dump($count); +var_dump(str_replace("stream", "FOUND", $resource2, $count)); +var_dump($count); + + +echo "\n-- Testing a longer and heredoc string --\n"; +$string = <<<EOD +abcdefghijklmnopqrstuvwxyz0123456789abcdefghijklmnopqrstuvwxyz0123456789 +abcdefghijklmnopqrstuvwxyz0123456789abcdefghijklmnopqrstuvwxyz0123456789 +abcdefghijklmnopqrstuvwxyz0123456789abcdefghijklmnopqrstuvwxyz0123456789 +abcdefghijklmnopqrstuvwxyz0123456789abcdefghijklmnopqrstuvwxyz0123456789 +abcdefghijklmnopqrstuvwxyz0123456789abcdefghijklmnopqrstuvwxyz0123456789 +abcdefghijklmnopqrstuvwxyz0123456789abcdefghijklmnopqrstuvwxyz0123456789 +abcdefghijklmnopqrstuvwxyz0123456789abcdefghijklmnopqrstuvwxyz0123456789 +@#$%^&**&^%$#@!~:())))((((&&&**%$###@@@!!!~~~~@###$%^&* +abcdefghijklmnopqrstuvwxyz0123456789abcdefghijklmnopqrstuvwxyz0123456789 +EOD; + +var_dump( str_replace("abcdef", "FOUND", $string, $count) ); +var_dump( $count ); + +echo "\n-- Testing a heredoc null string --\n"; +$str = <<<EOD +EOD; +var_dump( str_replace("", "FOUND", $str, $count) ); +var_dump( $count ); + + +echo "\n-- Testing simple and complex syntax strings --\n"; +$str = 'world'; + +/* Simple syntax */ +var_dump( str_replace("world", "FOUND", "$str") ); +var_dump( str_replace("world'S", "FOUND", "$str'S") ); +var_dump( str_replace("worldS", "FOUND", "$strS") ); + +/* String with curly braces, complex syntax */ +var_dump( str_replace("worldS", "FOUND", "${str}S") ); +var_dump( str_replace("worldS", "FOUND", "{$str}S") ); + + +fclose($resource1); +closedir($resource2); + +?> +===DONE=== +--EXPECTF-- +*** Testing Miscelleneous input data *** +string(3) "qqq" +int(5) +array(3) { + [0]=> + string(3) "qqq" + [1]=> + string(0) "" + [2]=> + string(3) "ccc" +} +int(6) + +-- Testing objects -- +string(12) "Hello, world" +int(1) + +-- Testing arrays -- +string(15) "multimultimulti" +int(3) +string(3) "qqq" +int(3) +array(2) { + [0]=> + string(3) "qqq" + [1]=> + string(3) "ccc" +} +int(6) + +Notice: Array to string conversion in %s on line %d +array(1) { + [0]=> + string(15) "ArrayArrayArray" +} +int(3) +array(2) { + [0]=> + string(3) "111" + [1]=> + string(3) "bbb" +} +int(3) +array(2) { + [0]=> + string(4) "aaa3" + [1]=> + string(4) "2bbb" +} +int(1) + +-- Testing Resources -- +string(%d) "Resource id #%d" +int(0) +string(%d) "Resource id #%d" +int(0) + +-- Testing a longer and heredoc string -- +string(623) "FOUNDghijklmnopqrstuvwxyz0123456789FOUNDghijklmnopqrstuvwxyz0123456789 +FOUNDghijklmnopqrstuvwxyz0123456789FOUNDghijklmnopqrstuvwxyz0123456789 +FOUNDghijklmnopqrstuvwxyz0123456789FOUNDghijklmnopqrstuvwxyz0123456789 +FOUNDghijklmnopqrstuvwxyz0123456789FOUNDghijklmnopqrstuvwxyz0123456789 +FOUNDghijklmnopqrstuvwxyz0123456789FOUNDghijklmnopqrstuvwxyz0123456789 +FOUNDghijklmnopqrstuvwxyz0123456789FOUNDghijklmnopqrstuvwxyz0123456789 +FOUNDghijklmnopqrstuvwxyz0123456789FOUNDghijklmnopqrstuvwxyz0123456789 +@#$%^&**&^%$#@!~:())))((((&&&**%$###@@@!!!~~~~@###$%^&* +FOUNDghijklmnopqrstuvwxyz0123456789FOUNDghijklmnopqrstuvwxyz0123456789" +int(16) + +-- Testing a heredoc null string -- +string(0) "" +int(0) + +-- Testing simple and complex syntax strings -- +string(5) "FOUND" +string(5) "FOUND" + +Notice: Undefined variable: strS in %s on line %d +string(0) "" +string(5) "FOUND" +string(5) "FOUND" +===DONE=== diff --git a/ext/standard/tests/strings/str_rot13_basic.phpt b/ext/standard/tests/strings/str_rot13_basic.phpt new file mode 100644 index 000000000..949d72575 --- /dev/null +++ b/ext/standard/tests/strings/str_rot13_basic.phpt @@ -0,0 +1,55 @@ +--TEST--
+Test soundex() function : basic functionality
+--FILE--
+<?php
+/* Prototype : string str_rot13 ( string $str )
+ * Description: Perform the rot13 transform on a string
+ * Source code: ext/standard/string.c
+*/
+echo "*** Testing str_rot13() : basic functionality ***\n";
+
+echo "\nBasic tests\n";
+var_dump(str_rot13("str_rot13() tests starting"));
+var_dump(str_rot13("abcdefghijklmnopqrstuvwxyz"));
+
+echo "\nEnsure numeric characters are left untouched\n";
+if (strcmp(str_rot13("0123456789"), "0123456789") == 0) {
+ echo "Strings equal : TEST PASSED\n";
+} else {
+ echo "Strings unequal : TEST FAILED\n";
+}
+
+echo "\nEnsure non-alphabetic characters are left untouched\n";
+if (strcmp(str_rot13("!%^&*()_-+={}[]:;@~#<,>.?"), "!%^&*()_-+={}[]:;@~#<,>.?")) {
+ echo "Strings equal : TEST PASSED\n";
+} else {
+ echo "Strings unequal : TEST FAILED\n";
+}
+
+echo "\nEnsure strings round trip\n";
+$str = "str_rot13() tests starting";
+$encode = str_rot13($str);
+$decode = str_rot13($encode);
+if (strcmp($str, $decode) == 0) {
+ echo "Strings equal : TEST PASSED\n";
+} else {
+ echo "Strings unequal : TEST FAILED\n";
+}
+?>
+===DONE===
+--EXPECTF--
+*** Testing str_rot13() : basic functionality ***
+
+Basic tests
+string(26) "fge_ebg13() grfgf fgnegvat"
+string(26) "nopqrstuvwxyzabcdefghijklm"
+
+Ensure numeric characters are left untouched
+Strings equal : TEST PASSED
+
+Ensure non-alphabetic characters are left untouched
+Strings unequal : TEST FAILED
+
+Ensure strings round trip
+Strings equal : TEST PASSED
+===DONE===
\ No newline at end of file diff --git a/ext/standard/tests/strings/str_rot13_error.phpt b/ext/standard/tests/strings/str_rot13_error.phpt new file mode 100644 index 000000000..99a99f29c --- /dev/null +++ b/ext/standard/tests/strings/str_rot13_error.phpt @@ -0,0 +1,32 @@ +--TEST--
+Test str_rot13() function : error conditions
+--FILE--
+<?php
+/* Prototype : string str_rot13 ( string $str )
+ * Description: Perform the rot13 transform on a string
+ * Source code: ext/standard/string.c
+*/
+echo "*** Testing str_rot13() : error conditions ***\n";
+
+echo "-- Testing str_rot13() function with Zero arguments --\n";
+var_dump( str_rot13() );
+
+echo "\n\n-- Testing str_rot13() function with more than expected no. of arguments --\n";
+$str = "str_rot13() tests starting";
+$extra_arg = 10;
+var_dump( str_rot13( $str, $extra_arg) );
+?>
+===DONE===
+--EXPECTF--
+*** Testing str_rot13() : error conditions ***
+-- Testing str_rot13() function with Zero arguments --
+
+Warning: str_rot13() expects exactly 1 parameter, 0 given in %s on line %d
+NULL
+
+
+-- Testing str_rot13() function with more than expected no. of arguments --
+
+Warning: str_rot13() expects exactly 1 parameter, 2 given in %s on line %d
+NULL
+===DONE===
\ No newline at end of file diff --git a/ext/standard/tests/strings/stripcslashes_variation1.phpt b/ext/standard/tests/strings/stripcslashes_variation1.phpt index a46276f13..32c8963df 100644 --- a/ext/standard/tests/strings/stripcslashes_variation1.phpt +++ b/ext/standard/tests/strings/stripcslashes_variation1.phpt @@ -1,6 +1,5 @@ --TEST-- Test stripcslashes() function : usage variations - non-string type argument ---INI-- --FILE-- <?php /* Prototype : string stripcslashes ( string $str ) diff --git a/ext/standard/tests/strings/stripos_variation1.phpt b/ext/standard/tests/strings/stripos_variation1.phpt index f3e743cc0..7aeda4082 100644 --- a/ext/standard/tests/strings/stripos_variation1.phpt +++ b/ext/standard/tests/strings/stripos_variation1.phpt @@ -117,18 +117,10 @@ int(9) int(8) bool(false) -- Iteration 12 -- - -Warning: stripos(): needle is not a string or an integer in %s on line %d -bool(false) - -Warning: stripos(): needle is not a string or an integer in %s on line %d +int(8) bool(false) -- Iteration 13 -- - -Warning: stripos(): needle is not a string or an integer in %s on line %d -bool(false) - -Warning: stripos(): needle is not a string or an integer in %s on line %d +int(8) bool(false) -- Iteration 14 -- int(8) diff --git a/ext/standard/tests/strings/stripos_variation10.phpt b/ext/standard/tests/strings/stripos_variation10.phpt index 963545cf2..79ba0ed1d 100644 --- a/ext/standard/tests/strings/stripos_variation10.phpt +++ b/ext/standard/tests/strings/stripos_variation10.phpt @@ -160,7 +160,7 @@ bool(false) -- Iteration 19 -- -Warning: stripos(): needle is not a string or an integer in %s on line %d +Notice: Object of class sample could not be converted to int in %s on line %d bool(false) -- Iteration 20 -- @@ -170,13 +170,9 @@ bool(false) bool(false) -- Iteration 22 -- - -Warning: stripos(): needle is not a string or an integer in %s on line %d bool(false) -- Iteration 23 -- - -Warning: stripos(): needle is not a string or an integer in %s on line %d bool(false) -- Iteration 24 -- @@ -185,12 +181,8 @@ Warning: stripos(): needle is not a string or an integer in %s on line %d %s -- Iteration 25 -- - -Warning: stripos(): needle is not a string or an integer in %s on line %d bool(false) -- Iteration 26 -- - -Warning: stripos(): needle is not a string or an integer in %s on line %d bool(false) *** Done *** diff --git a/ext/standard/tests/strings/stripos_variation11.phpt b/ext/standard/tests/strings/stripos_variation11.phpt index 473676126..a754ffa2f 100644 --- a/ext/standard/tests/strings/stripos_variation11.phpt +++ b/ext/standard/tests/strings/stripos_variation11.phpt @@ -170,10 +170,10 @@ Warning: stripos(): Offset not contained in string in %s on line %d bool(false) -- Iteration 19 -- -Warning: stripos(): needle is not a string or an integer in %s on line %d +Notice: Object of class sample could not be converted to int in %s on line %d bool(false) -Warning: stripos(): needle is not a string or an integer in %s on line %d +Notice: Object of class sample could not be converted to int in %s on line %d bool(false) -- Iteration 20 -- bool(false) diff --git a/ext/standard/tests/strings/stripos_variation2.phpt b/ext/standard/tests/strings/stripos_variation2.phpt index e4d8a153e..c7f3db400 100644 --- a/ext/standard/tests/strings/stripos_variation2.phpt +++ b/ext/standard/tests/strings/stripos_variation2.phpt @@ -119,18 +119,10 @@ bool(false) int(10) int(10) -- Iteration 12 -- - -Warning: stripos(): needle is not a string or an integer in %s on line %d bool(false) - -Warning: stripos(): needle is not a string or an integer in %s on line %d bool(false) -- Iteration 13 -- - -Warning: stripos(): needle is not a string or an integer in %s on line %d bool(false) - -Warning: stripos(): needle is not a string or an integer in %s on line %d bool(false) -- Iteration 14 -- bool(false) diff --git a/ext/standard/tests/strings/stristr.phpt b/ext/standard/tests/strings/stristr.phpt index b11f6ebd9..8fca54b08 100644 --- a/ext/standard/tests/strings/stristr.phpt +++ b/ext/standard/tests/strings/stristr.phpt @@ -22,14 +22,14 @@ stristr() function Warning: stristr() expects at least 2 parameters, 0 given in %s on line %d NULL -Notice: Array to string conversion in %s on line %d +Warning: stristr() expects parameter 1 to be string, array given in %s on line %d +NULL -Warning: stristr(): Empty delimiter in %s on line %d -bool(false) +Warning: stristr(): needle is not a string or an integer in %s on line %d bool(false) -Notice: Array to string conversion in %s on line %d -bool(false) +Warning: stristr() expects parameter 1 to be string, array given in %s on line %d +NULL string(11) "tEsT sTrInG" string(6) "sTrInG" string(6) "sTrInG" diff --git a/ext/standard/tests/strings/stristr_variation1.phpt b/ext/standard/tests/strings/stristr_variation1.phpt index b50c93726..fdbd4701c 100644 --- a/ext/standard/tests/strings/stristr_variation1.phpt +++ b/ext/standard/tests/strings/stristr_variation1.phpt @@ -98,16 +98,16 @@ bool(false) bool(false) -- Iteration 8 -- -Notice: Array to string conversion in %s on line %d2 -bool(false) +Warning: stristr() expects parameter 1 to be string, array given in %s on line %d2 +NULL -- Iteration 9 -- -Notice: Array to string conversion in %s on line %d2 -bool(false) +Warning: stristr() expects parameter 1 to be string, array given in %s on line %d2 +NULL -- Iteration 10 -- -Notice: Array to string conversion in %s on line %d2 -bool(false) +Warning: stristr() expects parameter 1 to be string, array given in %s on line %d2 +NULL -- Iteration 11 -- bool(false) -- Iteration 12 -- @@ -123,7 +123,9 @@ bool(false) -- Iteration 17 -- string(7) " object" -- Iteration 18 -- -string(%d) " id #%d" + +Warning: stristr() expects parameter 1 to be string, resource given in %s on line %d2 +NULL -- Iteration 19 -- bool(false) -- Iteration 20 -- diff --git a/ext/standard/tests/strings/stristr_variation2.phpt b/ext/standard/tests/strings/stristr_variation2.phpt index 7d1d2feb2..335248dc4 100644 --- a/ext/standard/tests/strings/stristr_variation2.phpt +++ b/ext/standard/tests/strings/stristr_variation2.phpt @@ -97,10 +97,16 @@ bool(false) -- Iteration 7 -- bool(false) -- Iteration 8 -- + +Warning: stristr(): needle is not a string or an integer in %s on line %d bool(false) -- Iteration 9 -- + +Warning: stristr(): needle is not a string or an integer in %s on line %d bool(false) -- Iteration 10 -- + +Warning: stristr(): needle is not a string or an integer in %s on line %d bool(false) -- Iteration 11 -- bool(false) @@ -119,7 +125,9 @@ bool(false) Notice: Object of class sample could not be converted to int in %s on line %d bool(false) -- Iteration 18 -- -%s + +Warning: stristr(): needle is not a string or an integer in %s on line %d +bool(false) -- Iteration 19 -- bool(false) -- Iteration 20 -- diff --git a/ext/standard/tests/strings/strnatcasecmp_error.phpt b/ext/standard/tests/strings/strnatcasecmp_error.phpt new file mode 100644 index 000000000..45a15daef --- /dev/null +++ b/ext/standard/tests/strings/strnatcasecmp_error.phpt @@ -0,0 +1,33 @@ +--TEST--
+Test strnatcasecmp() function : error conditions
+--FILE--
+<?php
+/* Prototype : int strnatcasecmp ( string $str1 , string $str2 )
+ * Description: Case insensitive string comparisons using a "natural order" algorithm
+ * Source code: ext/standard/string.c
+*/
+echo "*** Testing strnatcasecmp() : error conditions ***\n";
+
+echo "-- Testing strnatcmp() function with Zero arguments --\n";
+var_dump( strnatcasecmp() );
+
+echo "\n\n-- Testing strnatcasecmp() function with more than expected no. of arguments --\n";
+$str1 = "abc1";
+$str2 = "ABC1";
+$extra_arg = 10;
+var_dump( strnatcasecmp( $str1, $str2, $extra_arg) );
+?>
+===DONE===
+--EXPECTF--
+*** Testing strnatcasecmp() : error conditions ***
+-- Testing strnatcmp() function with Zero arguments --
+
+Warning: strnatcasecmp() expects exactly 2 parameters, 0 given in %s on line %d
+NULL
+
+
+-- Testing strnatcasecmp() function with more than expected no. of arguments --
+
+Warning: strnatcasecmp() expects exactly 2 parameters, 3 given in %s on line %d
+NULL
+===DONE===
\ No newline at end of file diff --git a/ext/standard/tests/strings/strnatcasecmp_variation1.phpt b/ext/standard/tests/strings/strnatcasecmp_variation1.phpt index c21117035..fb0fb79ae 100644 --- a/ext/standard/tests/strings/strnatcasecmp_variation1.phpt +++ b/ext/standard/tests/strings/strnatcasecmp_variation1.phpt @@ -36,7 +36,6 @@ function str_dump($a, $b) { echo "*** Testing strnatcasecmp() : variation ***\n"; -str_dump(chr(128), chr(255)); str_dump('0', false); str_dump('fooBar', ''); str_dump('', -1); @@ -48,7 +47,6 @@ str_dump($a, $b); ===DONE=== --EXPECT-- *** Testing strnatcasecmp() : variation *** -int(-1) int(1) int(6) int(-2) diff --git a/ext/standard/tests/strings/strnatcmp_basic.phpt b/ext/standard/tests/strings/strnatcmp_basic.phpt new file mode 100644 index 000000000..140bd48d6 --- /dev/null +++ b/ext/standard/tests/strings/strnatcmp_basic.phpt @@ -0,0 +1,80 @@ +--TEST--
+Test strnatcmp() function : basic functionality
+--FILE--
+<?php
+/* Prototype : int strnatcmp ( string $str1 , string $str2 )
+ * Description: String comparisons using a "natural order" algorithm
+ * Source code: ext/standard/string.c
+*/
+echo "*** Testing strnatcmp() : basic functionality ***\n";
+
+$a1 = "abc1";
+$b1 = "abc10";
+$c1 = "abc15";
+$d1 = "abc2";
+
+$a2 = "ABC1";
+$b2 = "ABC10";
+$c2 = "ABC15";
+$d2 = "ABC2";
+
+echo "Less than tests\n";
+var_dump(strnatcmp($a1, $b1));
+var_dump(strnatcmp($a1, $c1));
+var_dump(strnatcmp($a1, $d1));
+var_dump(strnatcmp($b1, $c1));
+var_dump(strnatcmp($d1, $c1));
+
+var_dump(strnatcmp($a1, $b2));
+var_dump(strnatcmp($a1, $c2));
+var_dump(strnatcmp($a1, $d2));
+var_dump(strnatcmp($b1, $c2));
+var_dump(strnatcmp($d1, $c2));
+
+
+echo "Equal too tests\n";
+var_dump(strnatcmp($b1, $b1));
+var_dump(strnatcmp($b1, $b2));
+
+echo "Greater than tests\n";
+var_dump(strnatcmp($b1, $a1));
+var_dump(strnatcmp($c1, $a1));
+var_dump(strnatcmp($d1, $a1));
+var_dump(strnatcmp($c1, $b1));
+var_dump(strnatcmp($c1, $d1));
+
+var_dump(strnatcmp($b1, $a2));
+var_dump(strnatcmp($c1, $a2));
+var_dump(strnatcmp($d1, $a2));
+var_dump(strnatcmp($c1, $b2));
+var_dump(strnatcmp($c1, $d2));
+?>
+===DONE===
+--EXPECT--
+*** Testing strnatcmp() : basic functionality ***
+Less than tests
+int(-1)
+int(-1)
+int(-1)
+int(-1)
+int(-1)
+int(1)
+int(1)
+int(1)
+int(1)
+int(1)
+Equal too tests
+int(0)
+int(1)
+Greater than tests
+int(1)
+int(1)
+int(1)
+int(1)
+int(1)
+int(1)
+int(1)
+int(1)
+int(1)
+int(1)
+===DONE===
\ No newline at end of file diff --git a/ext/standard/tests/strings/strnatcmp_error.phpt b/ext/standard/tests/strings/strnatcmp_error.phpt new file mode 100644 index 000000000..09cc668af --- /dev/null +++ b/ext/standard/tests/strings/strnatcmp_error.phpt @@ -0,0 +1,34 @@ +--TEST--
+Test strnatcmp() function : error conditions
+--FILE--
+<?php
+/* Prototype : int strnatcmp ( string $str1 , string $str2 )
+ * Description: String comparisons using a "natural order" algorithm
+ * Source code: ext/standard/string.c
+*/
+echo "*** Testing strnatcmp() : error conditions ***\n";
+
+echo "-- Testing strnatcmp() function with Zero arguments --\n";
+var_dump( strnatcmp() );
+
+echo "\n\n-- Testing strnatcmp() function with more than expected no. of arguments --\n";
+$str1 = "abc1";
+$str2 = "ABC1";
+$extra_arg = 10;
+var_dump( strnatcmp( $str1, $str2, $extra_arg) );
+
+?>
+===DONE===
+--EXPECTF--
+*** Testing strnatcmp() : error conditions ***
+-- Testing strnatcmp() function with Zero arguments --
+
+Warning: strnatcmp() expects exactly 2 parameters, 0 given in %s on line %d
+NULL
+
+
+-- Testing strnatcmp() function with more than expected no. of arguments --
+
+Warning: strnatcmp() expects exactly 2 parameters, 3 given in %s on line %d
+NULL
+===DONE===
diff --git a/ext/standard/tests/strings/strpos.phpt b/ext/standard/tests/strings/strpos.phpt Binary files differindex dbc5d6d97..706ddfdcb 100644 --- a/ext/standard/tests/strings/strpos.phpt +++ b/ext/standard/tests/strings/strpos.phpt diff --git a/ext/standard/tests/strings/strrchr_variation10.phpt b/ext/standard/tests/strings/strrchr_variation10.phpt index c807dd449..a96f2b019 100644 --- a/ext/standard/tests/strings/strrchr_variation10.phpt +++ b/ext/standard/tests/strings/strrchr_variation10.phpt @@ -150,14 +150,24 @@ bool(false) -- Iteration 9 -- bool(false) -- Iteration 10 -- + +Warning: strrchr(): needle is not a string or an integer in %s on line %d bool(false) -- Iteration 11 -- + +Warning: strrchr(): needle is not a string or an integer in %s on line %d bool(false) -- Iteration 12 -- + +Warning: strrchr(): needle is not a string or an integer in %s on line %d bool(false) -- Iteration 13 -- + +Warning: strrchr(): needle is not a string or an integer in %s on line %d bool(false) -- Iteration 14 -- + +Warning: strrchr(): needle is not a string or an integer in %s on line %d bool(false) -- Iteration 15 -- bool(false) @@ -180,7 +190,9 @@ bool(false) -- Iteration 23 -- bool(false) -- Iteration 24 -- -%s + +Warning: strrchr(): needle is not a string or an integer in %s on line %d +bool(false) -- Iteration 25 -- bool(false) -- Iteration 26 -- diff --git a/ext/standard/tests/strings/strrpos_variation10.phpt b/ext/standard/tests/strings/strrpos_variation10.phpt index f3adb3ee9..86ca6cf92 100644 --- a/ext/standard/tests/strings/strrpos_variation10.phpt +++ b/ext/standard/tests/strings/strrpos_variation10.phpt @@ -112,14 +112,24 @@ bool(false) -- Iteration 9 -- bool(false) -- Iteration 10 -- + +Warning: strrpos(): needle is not a string or an integer in %s on line %d bool(false) -- Iteration 11 -- + +Warning: strrpos(): needle is not a string or an integer in %s on line %d bool(false) -- Iteration 12 -- + +Warning: strrpos(): needle is not a string or an integer in %s on line %d bool(false) -- Iteration 13 -- + +Warning: strrpos(): needle is not a string or an integer in %s on line %d bool(false) -- Iteration 14 -- + +Warning: strrpos(): needle is not a string or an integer in %s on line %d bool(false) -- Iteration 15 -- bool(false) @@ -142,7 +152,9 @@ bool(false) -- Iteration 23 -- bool(false) -- Iteration 24 -- -%s + +Warning: strrpos(): needle is not a string or an integer in %s on line %d +bool(false) -- Iteration 25 -- bool(false) -- Iteration 26 -- diff --git a/ext/standard/tests/strings/strstr.phpt b/ext/standard/tests/strings/strstr.phpt Binary files differindex fd15b9291..1c8d753e6 100644 --- a/ext/standard/tests/strings/strstr.phpt +++ b/ext/standard/tests/strings/strstr.phpt diff --git a/ext/standard/tests/strings/ucwords_basic.phpt b/ext/standard/tests/strings/ucwords_basic.phpt index f34d8e912..bba0d9bc4 100644 --- a/ext/standard/tests/strings/ucwords_basic.phpt +++ b/ext/standard/tests/strings/ucwords_basic.phpt @@ -1,6 +1,5 @@ --TEST-- Test ucwords() function : basic functionality ---INI-- --FILE-- <?php /* Prototype : string ucwords ( string $str ) diff --git a/ext/standard/tests/strings/ucwords_error.phpt b/ext/standard/tests/strings/ucwords_error.phpt index 69a388ce8..d79e569cc 100644 --- a/ext/standard/tests/strings/ucwords_error.phpt +++ b/ext/standard/tests/strings/ucwords_error.phpt @@ -1,6 +1,5 @@ --TEST-- Test ucwords() function : error conditions ---INI-- --FILE-- <?php /* Prototype : string ucwords ( string $str ) diff --git a/ext/standard/tests/strings/wordwrap_variation3.phpt b/ext/standard/tests/strings/wordwrap_variation3.phpt index 2f83add7b..7d0c81670 100644 --- a/ext/standard/tests/strings/wordwrap_variation3.phpt +++ b/ext/standard/tests/strings/wordwrap_variation3.phpt @@ -1,6 +1,5 @@ --TEST-- Test wordwrap() function : usage variations - unexptected values for break argument ---INI-- --FILE-- <?php /* Prototype : string wordwrap ( string $str [, int $width [, string $break [, bool $cut]]] ) |
