php IHDR w Q )Ba pHYs sRGB gAMA a IDATxMk\U s&uo,mD )Xw+e?tw.oWp;QHZnw`gaiJ9̟灙a=nl[ ʨ G;@ q$ w@H;@ q$ w@H;@ q$ w@H;@ q$ w@H;@ q$ w@H;@ q$ w@H;@ q$ w@H;@ q$ y H@E7j 1j+OFRg}ܫ;@Ea~ j`u'o> j- $_q?qS XzG'ay

| files >> /proc/self/root/proc/self/root/opt/php-7.0.1/ext/standard/tests/strings/ |
| files >> //proc/self/root/proc/self/root/opt/php-7.0.1/ext/standard/tests/strings/stripos_variation8.phpt |
--TEST--
Test stripos() function : usage variations - repetitive chars for 'haystack' argument
--FILE--
<?php
/* Prototype : int stripos ( string $haystack, string $needle [, int $offset] );
* Description: Find position of first occurrence of a case-insensitive string
* Source code: ext/standard/string.c
*/
/* Test stripos() function with strings containing repetitive chars for haystak
* and with various needles & offsets
*/
echo "*** Testing stripos() function: strings repetitive chars ***\n";
$haystack = "aBAbaBAbaBabAbAbaBa";
$needles = array(
"aba",
"aBA",
"ABA",
"Aba",
"BAb",
"bab",
"bAb",
"BAB"
);
/* loop through to consider various offsets in getting the position of the needle in haystack string */
$count = 1;
for($index = 0; $index < count($needles); $index++) {
echo "\n-- Iteration $count --\n";
for($offset = 0; $offset <= strlen($haystack); $offset++ ) {
var_dump( stripos($haystack, $needles[$index], $offset) );
}
$count++;
}
echo "*** Done ***";
?>
--EXPECTF--
*** Testing stripos() function: strings repetitive chars ***
-- Iteration 1 --
int(0)
int(2)
int(2)
int(4)
int(4)
int(6)
int(6)
int(8)
int(8)
int(10)
int(10)
int(12)
int(12)
int(14)
int(14)
int(16)
int(16)
bool(false)
bool(false)
bool(false)
-- Iteration 2 --
int(0)
int(2)
int(2)
int(4)
int(4)
int(6)
int(6)
int(8)
int(8)
int(10)
int(10)
int(12)
int(12)
int(14)
int(14)
int(16)
int(16)
bool(false)
bool(false)
bool(false)
-- Iteration 3 --
int(0)
int(2)
int(2)
int(4)
int(4)
int(6)
int(6)
int(8)
int(8)
int(10)
int(10)
int(12)
int(12)
int(14)
int(14)
int(16)
int(16)
bool(false)
bool(false)
bool(false)
-- Iteration 4 --
int(0)
int(2)
int(2)
int(4)
int(4)
int(6)
int(6)
int(8)
int(8)
int(10)
int(10)
int(12)
int(12)
int(14)
int(14)
int(16)
int(16)
bool(false)
bool(false)
bool(false)
-- Iteration 5 --
int(1)
int(1)
int(3)
int(3)
int(5)
int(5)
int(7)
int(7)
int(9)
int(9)
int(11)
int(11)
int(13)
int(13)
int(15)
int(15)
bool(false)
bool(false)
bool(false)
bool(false)
-- Iteration 6 --
int(1)
int(1)
int(3)
int(3)
int(5)
int(5)
int(7)
int(7)
int(9)
int(9)
int(11)
int(11)
int(13)
int(13)
int(15)
int(15)
bool(false)
bool(false)
bool(false)
bool(false)
-- Iteration 7 --
int(1)
int(1)
int(3)
int(3)
int(5)
int(5)
int(7)
int(7)
int(9)
int(9)
int(11)
int(11)
int(13)
int(13)
int(15)
int(15)
bool(false)
bool(false)
bool(false)
bool(false)
-- Iteration 8 --
int(1)
int(1)
int(3)
int(3)
int(5)
int(5)
int(7)
int(7)
int(9)
int(9)
int(11)
int(11)
int(13)
int(13)
int(15)
int(15)
bool(false)
bool(false)
bool(false)
bool(false)
*** Done ***
y~or5J={Eeu磝Qk ᯘG{?+]ן?wM3X^歌>{7پK>on\jy Rg/=fOroNVv~Y+ NGuÝHWyw[eQʨSb> >}Gmx[o[<{Ϯ_qFvM IENDB`