var_dump( $count );
$fp = fopen( __FILE__, "r" );
-var_dump( str_replace($fp, $fp, $fp, $fp) );
-var_dump( $fp );
+$fp_copy = $fp;
+var_dump( str_replace($fp_copy, $fp_copy, $fp_copy, $fp_copy) );
+var_dump( $fp_copy );
+fclose($fp);
echo "\n*** Testing str_replace() with various search values ***";
$search_arr = array( TRUE, FALSE, 1, 0, -1, "1", "0", "-1", NULL,
var_dump( str_replace(1, 2) );
var_dump( str_replace(1,2,3,$var,5) );
-echo "Done\n";
-
---CLEAN--
-fclose($fp);
fclose($resource1);
closedir($resource2);
+echo "Done\n";
?>
--EXPECTF--
int(1)
string(0) ""
int(0)
-string(14) "Resource id #5"
+string(%d) "Resource id #%d"
int(1)
*** Testing str_replace() with various search values ***
int(1)
-- Testing Resources --
-string(14) "Resource id #6"
+string(%d) "Resource id #%d"
int(0)
-string(14) "Resource id #7"
+string(%d) "Resource id #%d"
int(0)
-- Testing a longer and heredoc string --
// float values
10.5,
-10.5,
- 10.5e10,
- 10.6E-10,
+ 10.1234567e10,
+ 10.7654321E-10,
.5,
// array values
$counter = 1;
for($index = 0; $index < count($values); $index ++) {
echo "-- Iteration $counter --\n";
- $haystack = $values[$index];
-
var_dump( strrchr($values[$index], $values[$index]) );
$counter ++;
}
-- Iteration 23 --
bool(false)
-- Iteration 24 --
-bool(false)
+%s
-- Iteration 25 --
bool(false)
-- Iteration 26 --