Annotation of embedaddon/php/ext/standard/tests/strings/strrev_basic.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Test strrev() function : basic functionality
3: --FILE--
4: <?php
5: /* Prototype : string strrev(string $str);
6: * Description: Reverse a string
7: * Source code: ext/standard/string.c
8: */
9:
10: echo "*** Testing strrev() : basic functionality ***\n";
11: $heredoc = <<<EOD
12: Hello, world
13: EOD;
14:
15: //regular string
16: var_dump( strrev("Hello, World") );
17: var_dump( strrev('Hello, World') );
18:
19: //single character
20: var_dump( strrev("H") );
21: var_dump( strrev('H') );
22:
23: //string containing simalr chars
24: var_dump( strrev("HHHHHH") );
25: var_dump( strrev("HhhhhH") );
26:
27: //string containing escape char
28: var_dump( strrev("Hello, World\n") );
29: var_dump( strrev('Hello, World\n') );
30:
31: //heredoc string
32: var_dump( strrev($heredoc) );
33: echo "*** Done ***";
34: ?>
35: --EXPECTF--
36: *** Testing strrev() : basic functionality ***
37: string(12) "dlroW ,olleH"
38: string(12) "dlroW ,olleH"
39: string(1) "H"
40: string(1) "H"
41: string(6) "HHHHHH"
42: string(6) "HhhhhH"
43: string(13) "
44: dlroW ,olleH"
45: string(14) "n\dlroW ,olleH"
46: string(12) "dlrow ,olleH"
47: *** Done ***
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>