source: branches/version-2_5-dev/data/module/Compat/tests/function/strripos.phpt @ 19792

Revision 19792, 1.0 KB checked in by Seasoft, 13 years ago (diff)

#744(PHP4 互換用途ソースを将来的に切り捨てやすい仕組みづくり)

Line 
1--TEST--
2Function -- strripos
3--SKIPIF--
4<?php if (function_exists('strripos')) { echo 'skip'; } ?>
5--FILE--
6<?php
7require_once 'PHP/Compat.php';
8PHP_Compat::loadFunction('strripos');
9
10$haystack = 'Cat Dinner Dog Lion Mouse Sheep Wolf Cat Dog Donut';
11$needle  = 'DOG';
12
13// Simple
14var_dump(strripos($haystack, $needle));
15
16// With offset
17var_dump(strripos($haystack, $needle, 3));
18var_dump(strripos($haystack, $needle, 30));
19var_dump(strripos($haystack, $needle, 50));
20var_dump(strripos($haystack, $needle, -1));
21var_dump(strripos($haystack, $needle, -10));
22var_dump(strripos($haystack, $needle, -30));
23var_dump(strripos($haystack, $needle, -50));
24
25// Test for Bug xx
26var_dump(strripos($haystack, 'How about no'));
27
28// Test for negative offset scanning bug
29var_dump(strripos('abcdef', 'bc', -5));
30var_dump(strripos('aaafrogaa', 'frog', -5));
31
32// Bug #5049
33var_dump(strripos('testing', 'test'));
34
35?>
36--EXPECT--
37int(41)
38int(41)
39int(41)
40bool(false)
41int(41)
42int(11)
43int(11)
44bool(false)
45bool(false)
46int(1)
47int(3)
48int(0)
Note: See TracBrowser for help on using the repository browser.