1--TEST--
2Test str_replace() function basic function
3--INI--
4precision=14
5--FILE--
6<?php
7echo "\n*** Testing str_replace() on basic operations ***\n";
8
9var_dump( str_replace("", "", "") );
10
11var_dump( str_replace("e", "b", "test") );
12
13var_dump( str_replace("", "", "", $count) );
14var_dump( $count );
15
16var_dump( str_replace("q", "q", "q", $count) );
17var_dump( $count );
18
19var_dump( str_replace("long string here", "", "", $count) );
20var_dump( $count );
21
22$fp = fopen( __FILE__, "r" );
23$fp_copy = $fp;
24try {
25    var_dump( str_replace($fp_copy, $fp_copy, $fp_copy, $fp_copy) );
26} catch (TypeError $e) {
27    echo $e->getMessage(), "\n";
28}
29var_dump( $fp_copy );
30fclose($fp);
31
32?>
33--EXPECTF--
34*** Testing str_replace() on basic operations ***
35string(0) ""
36string(4) "tbst"
37string(0) ""
38int(0)
39string(1) "q"
40int(1)
41string(0) ""
42int(0)
43str_replace(): Argument #1 ($search) must be of type array|string, resource given
44resource(%d) of type (stream)
45