1--TEST--
2Test str_replace() function basic function
3--INI--
4precision=14
5--FILE--
6<?php
7/*
8  Prototype: mixed str_replace(mixed $search, mixed $replace,
9                               mixed $subject [, int &$count]);
10  Description: Replace all occurrences of the search string with
11               the replacement string
12*/
13
14echo "\n*** Testing str_replace() on basic operations ***\n";
15
16var_dump( str_replace("", "", "") );
17
18var_dump( str_replace("e", "b", "test") );
19
20var_dump( str_replace("", "", "", $count) );
21var_dump( $count );
22
23var_dump( str_replace("q", "q", "q", $count) );
24var_dump( $count );
25
26var_dump( str_replace("long string here", "", "", $count) );
27var_dump( $count );
28
29$fp = fopen( __FILE__, "r" );
30$fp_copy = $fp;
31var_dump( str_replace($fp_copy, $fp_copy, $fp_copy, $fp_copy) );
32var_dump( $fp_copy );
33fclose($fp);
34
35?>
36===DONE===
37--EXPECTF--
38*** Testing str_replace() on basic operations ***
39string(0) ""
40string(4) "tbst"
41string(0) ""
42int(0)
43string(1) "q"
44int(1)
45string(0) ""
46int(0)
47string(%d) "Resource id #%d"
48int(1)
49===DONE===
50