diff options
Diffstat (limited to 'ext/standard/tests/strings/str_replace_variation3.phpt')
| -rw-r--r-- | ext/standard/tests/strings/str_replace_variation3.phpt | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/ext/standard/tests/strings/str_replace_variation3.phpt b/ext/standard/tests/strings/str_replace_variation3.phpt index 8f6f38f1f9..8ae709745f 100644 --- a/ext/standard/tests/strings/str_replace_variation3.phpt +++ b/ext/standard/tests/strings/str_replace_variation3.phpt @@ -4,26 +4,26 @@ Test str_replace() function precision=14 --FILE-- <?php -/* - Prototype: mixed str_replace(mixed $search, mixed $replace, +/* + Prototype: mixed str_replace(mixed $search, mixed $replace, mixed $subject [, int &$count]); - Description: Replace all occurrences of the search string with + 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 +/* 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"), +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"), +var_dump( str_replace(array("a", "a", "b"), + array("q", "q"), + array("aaa", "bbb", "ccc"), $count ) ); @@ -35,7 +35,7 @@ echo "\n-- Testing objects --\n"; to string" by default, when an object is passed instead of string: The error can be avoided by choosing the __toString magix method as follows: */ -class subject +class subject { function __toString() { return "Hello, world"; @@ -43,7 +43,7 @@ class subject } $obj_subject = new subject; -class search +class search { function __toString() { return "Hello, world"; @@ -51,7 +51,7 @@ class search } $obj_search = new search; -class replace +class replace { function __toString() { return "Hello, world"; @@ -68,15 +68,15 @@ 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"), + array("q", "q", "c"), "aaa", $count ) ); var_dump($count); var_dump(str_replace( array("a", "a", "b"), - array("q", "q", "c"), - array("aaa", "bbb"), + array("q", "q", "c"), + array("aaa", "bbb"), $count ) ); @@ -95,7 +95,7 @@ var_dump($count); echo "\n-- Testing Resources --\n"; $resource1 = fopen( __FILE__, "r" ); $resource2 = opendir( "." ); -var_dump(str_replace("stream", "FOUND", $resource1, $count)); +var_dump(str_replace("stream", "FOUND", $resource1, $count)); var_dump($count); var_dump(str_replace("stream", "FOUND", $resource2, $count)); var_dump($count); @@ -142,7 +142,7 @@ closedir($resource2); ?> ===DONE=== ---EXPECTF-- +--EXPECTF-- *** Testing Miscelleneous input data *** string(3) "qqq" int(5) |
