mirror of
https://github.com/php/php-src.git
synced 2024-12-15 21:05:51 +08:00
fix tests
This commit is contained in:
parent
f95ac18b82
commit
4b731b1af0
@ -27,8 +27,10 @@ var_dump( str_replace("long string here", "", "", $count) );
|
||||
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,
|
||||
@ -230,12 +232,9 @@ var_dump( str_replace(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--
|
||||
@ -248,7 +247,7 @@ string(1) "q"
|
||||
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 ***
|
||||
@ -910,9 +909,9 @@ array(2) {
|
||||
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 --
|
||||
|
@ -41,8 +41,8 @@ $needles = array (
|
||||
// float values
|
||||
10.5,
|
||||
-10.5,
|
||||
10.5e10,
|
||||
10.6E-10,
|
||||
10.1234567e10,
|
||||
10.7654321E-10,
|
||||
.5,
|
||||
|
||||
// array values
|
||||
@ -182,7 +182,7 @@ bool(false)
|
||||
-- Iteration 24 --
|
||||
|
||||
Warning: stripos(): needle is not a string or an integer in %s on line %d
|
||||
bool(false)
|
||||
%s
|
||||
|
||||
-- Iteration 25 --
|
||||
|
||||
|
Binary file not shown.
@ -79,8 +79,8 @@ $needles = array (
|
||||
// float values
|
||||
10.5,
|
||||
-10.5,
|
||||
10.5e10,
|
||||
10.6E-10,
|
||||
10.1234567e10,
|
||||
10.7654321E-10,
|
||||
.5,
|
||||
|
||||
// array values
|
||||
@ -180,7 +180,7 @@ bool(false)
|
||||
-- Iteration 23 --
|
||||
bool(false)
|
||||
-- Iteration 24 --
|
||||
bool(false)
|
||||
%s
|
||||
-- Iteration 25 --
|
||||
bool(false)
|
||||
-- Iteration 26 --
|
||||
|
@ -37,8 +37,8 @@ $values = array (
|
||||
// float values
|
||||
10.5,
|
||||
-10.5,
|
||||
10.5e10,
|
||||
10.6E-10,
|
||||
10.1234567e10,
|
||||
10.7654321E-10,
|
||||
.5,
|
||||
|
||||
// array values
|
||||
@ -80,8 +80,6 @@ $values = array (
|
||||
$counter = 1;
|
||||
for($index = 0; $index < count($values); $index ++) {
|
||||
echo "-- Iteration $counter --\n";
|
||||
$haystack = $values[$index];
|
||||
|
||||
var_dump( strrchr($values[$index], $values[$index]) );
|
||||
$counter ++;
|
||||
}
|
||||
@ -151,7 +149,7 @@ bool(false)
|
||||
-- Iteration 23 --
|
||||
bool(false)
|
||||
-- Iteration 24 --
|
||||
bool(false)
|
||||
%s
|
||||
-- Iteration 25 --
|
||||
bool(false)
|
||||
-- Iteration 26 --
|
||||
|
@ -41,8 +41,8 @@ $needles = array (
|
||||
// float values
|
||||
10.5,
|
||||
-10.5,
|
||||
10.5e10,
|
||||
10.6E-10,
|
||||
10.1234567e10,
|
||||
10.7654321E-10,
|
||||
.5,
|
||||
|
||||
// array values
|
||||
@ -142,7 +142,7 @@ bool(false)
|
||||
-- Iteration 23 --
|
||||
bool(false)
|
||||
-- Iteration 24 --
|
||||
bool(false)
|
||||
%s
|
||||
-- Iteration 25 --
|
||||
bool(false)
|
||||
-- Iteration 26 --
|
||||
|
Binary file not shown.
Loading…
Reference in New Issue
Block a user