strrpos_variation8.phpt [plain text]
--TEST--
Test strrpos() function : usage variations - repetitive chars for 'haystack' argument
--FILE--
<?php
echo "*** Testing strrpos() function: strings repetitive chars ***\n";
$haystack = "ababababAbaBa";
$needle = "aba";
$count = 1;
for($offset = -1; $offset <= strlen($haystack); $offset++ ) {
echo "-- Iteration $count --\n";
var_dump( strrpos($haystack, $needle, $offset) );
$count++;
}
echo "*** Done ***";
?>
--EXPECTF--
*** Testing strrpos() function: strings repetitive chars ***
-- Iteration 1 --
int(4)
-- Iteration 2 --
int(4)
-- Iteration 3 --
int(4)
-- Iteration 4 --
int(4)
-- Iteration 5 --
int(4)
-- Iteration 6 --
int(4)
-- Iteration 7 --
bool(false)
-- Iteration 8 --
bool(false)
-- Iteration 9 --
bool(false)
-- Iteration 10 --
bool(false)
-- Iteration 11 --
bool(false)
-- Iteration 12 --
bool(false)
-- Iteration 13 --
bool(false)
-- Iteration 14 --
bool(false)
-- Iteration 15 --
bool(false)
*** Done ***