1--TEST--
2Test str_replace() function error conditions
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
14
15echo "\n*** Testing str_replace error conditions ***";
16/* Invalid arguments */
17var_dump( str_replace() );
18var_dump( str_replace("") );
19var_dump( str_replace(NULL) );
20var_dump( str_replace(1, 2) );
21var_dump( str_replace(1,2,3,$var,5) );
22
23?>
24===DONE===
25--EXPECTF--
26*** Testing str_replace error conditions ***
27Warning: str_replace() expects at least 3 parameters, 0 given in %sstr_replace_error.php on line 12
28NULL
29
30Warning: str_replace() expects at least 3 parameters, 1 given in %sstr_replace_error.php on line 13
31NULL
32
33Warning: str_replace() expects at least 3 parameters, 1 given in %sstr_replace_error.php on line 14
34NULL
35
36Warning: str_replace() expects at least 3 parameters, 2 given in %sstr_replace_error.php on line 15
37NULL
38
39Warning: str_replace() expects at most 4 parameters, 5 given in %sstr_replace_error.php on line 16
40NULL
41===DONE===
42