Revision 19792,
469 bytes
checked in by Seasoft, 13 years ago
(diff) |
#744(PHP4 互換用途ソースを将来的に切り捨てやすい仕組みづくり)
|
Line | |
---|
1 | --TEST-- |
---|
2 | Function -- substr_compare |
---|
3 | --SKIPIF-- |
---|
4 | <?php if (function_exists('substr_compare')) { echo 'skip'; } ?> |
---|
5 | --FILE-- |
---|
6 | <?php |
---|
7 | require_once 'PHP/Compat.php'; |
---|
8 | PHP_Compat::loadFunction('substr_compare'); |
---|
9 | |
---|
10 | echo substr_compare("abcde", "bc", 1, 2), "\n"; |
---|
11 | echo substr_compare("abcde", "bcg", 1, 2), "\n"; |
---|
12 | echo substr_compare("abcde", "BC", 1, 2, true), "\n"; |
---|
13 | echo substr_compare("abcde", "bc", 1, 3), "\n"; |
---|
14 | echo substr_compare("abcde", "cd", 1, 2); |
---|
15 | ?> |
---|
16 | --EXPECT-- |
---|
17 | 0 |
---|
18 | 0 |
---|
19 | 0 |
---|
20 | 1 |
---|
21 | -1 |
---|
Note: See
TracBrowser
for help on using the repository browser.