1--TEST--
2Test 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
10echo "*** Testing strrev() : basic functionality ***\n";
11$heredoc = <<<EOD
12Hello, world
13EOD;
14
15//regular string
16var_dump( strrev("Hello, World") );
17var_dump( strrev('Hello, World') );
18
19//single character
20var_dump( strrev("H") );
21var_dump( strrev('H') );
22
23//string containing simalr chars
24var_dump( strrev("HHHHHH") );
25var_dump( strrev("HhhhhH") );
26
27//string containing escape char
28var_dump( strrev("Hello, World\n") );
29var_dump( strrev('Hello, World\n') );
30
31//heredoc string
32var_dump( strrev($heredoc) );
33echo "*** Done ***";
34?>
35--EXPECTF--
36*** Testing strrev() : basic functionality ***
37string(12) "dlroW ,olleH"
38string(12) "dlroW ,olleH"
39string(1) "H"
40string(1) "H"
41string(6) "HHHHHH"
42string(6) "HhhhhH"
43string(13) "
44dlroW ,olleH"
45string(14) "n\dlroW ,olleH"
46string(12) "dlrow ,olleH"
47*** Done ***
48