import zend standard tests
[hiphop-php.git] / hphp / test / zend / good / ext-standard-strings / strrev_variation2.php
blob28600fb3996064e8d38a96e1e93250fe38704a0d
1 <?php
2 /* Prototype : string strrev(string $str);
3 * Description: Reverse a string
4 * Source code: ext/standard/string.c
5 */
7 /* Testing strrev() function with various single quoted strings for 'str' */
9 echo "*** Testing strrev() : with various single quoted strings ***\n";
10 $str = 'Hiiii';
12 $strings = array(
13 //strings containing escape chars
14 'hello\\world',
15 'hello\$world',
16 '\ttesting\ttesting\tstrrev',
17 'testing\rstrrev testing strrev',
18 'testing\fstrrev \f testing \nstrrev',
19 '\ntesting\nstrrev\n testing \n strrev',
20 'using\vvertical\vtab',
22 //polyndrome strings
23 'HelloolleH',
24 'ababababababa',
26 //numeric + strings
27 'Hello123',
28 '123Hello',
29 '123.34Hello',
30 'Hello1.234',
31 '123Hello1.234',
33 //concatenated strings
34 'Hello'.chr(0).'World',
35 'Hello'.'world',
36 'Hello'.$str,
38 //strings containing white spaces
39 ' h',
40 'h ',
41 ' h ',
42 'h e l l o ',
44 //strings containing quotes
45 '\hello\'world',
46 'hello\"world',
48 //special chars in string
49 't@@#$% %test ^test &test *test +test -test',
50 '!test ~test `test` =test= @test@test.com',
51 '/test/r\test\strrev\t\u /uu/',
53 //only special chars
54 '!@#$%^&*()_+=-`~'
57 $count = 1;
58 for( $index = 0; $index < count($strings); $index++ ) {
59 echo "\n-- Iteration $count --\n";
60 var_dump( strrev($strings[$index]) );
61 $count ++;
64 echo "*** Done ***";