File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / ext / standard / tests / strings / strrev_basic.phpt
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Tue Feb 21 23:48:04 2012 UTC (12 years, 5 months ago) by misho
Branches: php, MAIN
CVS tags: v5_4_3elwix, v5_4_29p0, v5_4_29, v5_4_20p0, v5_4_20, v5_4_17p0, v5_4_17, v5_3_10, HEAD
php

--TEST--
Test strrev() function : basic functionality 
--FILE--
<?php
/* Prototype  : string strrev(string $str);
 * Description: Reverse a string 
 * Source code: ext/standard/string.c
*/

echo "*** Testing strrev() : basic functionality ***\n";
$heredoc = <<<EOD
Hello, world
EOD;

//regular string
var_dump( strrev("Hello, World") );
var_dump( strrev('Hello, World') );

//single character
var_dump( strrev("H") );
var_dump( strrev('H') );

//string containing simalr chars
var_dump( strrev("HHHHHH") );
var_dump( strrev("HhhhhH") );

//string containing escape char
var_dump( strrev("Hello, World\n") );
var_dump( strrev('Hello, World\n') );

//heredoc string
var_dump( strrev($heredoc) );
echo "*** Done ***";
?>
--EXPECTF--
*** Testing strrev() : basic functionality ***
string(12) "dlroW ,olleH"
string(12) "dlroW ,olleH"
string(1) "H"
string(1) "H"
string(6) "HHHHHH"
string(6) "HhhhhH"
string(13) "
dlroW ,olleH"
string(14) "n\dlroW ,olleH"
string(12) "dlrow ,olleH"
*** Done ***

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>