import zend standard tests
[hiphop-php.git] / hphp / test / zend / good / ext-standard-strings / strcspn_basic.php
blob22b5be5e20b2ed3642950abcba18dd98b1ecd0dc
1 <?php
2 /* Prototype : proto int strcspn(string str, string mask [, int start [, int len]])
3 * Description: Finds length of initial segment consisting entirely of characters not found in mask.
4 If start or/and length is provided, it works like strcspn(substr($s,$start,$len),$bad_chars)
5 * Source code: ext/standard/string.c
6 * Alias to functions: none
7 */
9 /*
10 * Testing strcspn() : basic functionality
13 echo "*** Testing strcspn() : basic functionality ***\n";
16 // Initialise all required variables
17 $str = "this is the test string";
18 $mask = "es";
19 $start = 15;
20 $len = 30;
22 // Calling strcspn() with all possible arguments
23 var_dump( strcspn($str, $mask, $start, $len) );
25 // Calling strcspn() with three arguments
26 var_dump( strcspn($str, $mask, $start) );
28 // Calling strcspn() with default arguments
29 var_dump( strcspn($str, $mask) );
31 echo "Done"