summaryrefslogtreecommitdiff
path: root/ext/standard/tests/strings/strrev_variation1.phpt
blob: 8fd957777a1ef7cbda40f23860c881928f81b797 (plain)
ofshex dumpascii
0000 2d 2d 54 45 53 54 2d 2d 0a 54 65 73 74 20 73 74 72 72 65 76 28 29 20 66 75 6e 63 74 69 6f 6e 20 --TEST--.Test.strrev().function.
0020 3a 20 75 73 61 67 65 20 76 61 72 69 61 74 69 6f 6e 73 20 2d 20 64 6f 75 62 6c 65 20 71 75 6f 74 :.usage.variations.-.double.quot
0040 65 64 20 73 74 72 69 6e 67 73 0a 2d 2d 46 49 4c 45 2d 2d 0a 3c 3f 70 68 70 0a 2f 2a 20 50 72 6f ed.strings.--FILE--.<?php./*.Pro
0060 74 6f 74 79 70 65 20 20 3a 20 73 74 72 69 6e 67 20 73 74 72 72 65 76 28 73 74 72 69 6e 67 20 24 totype..:.string.strrev(string.$
0080 73 74 72 29 3b 0a 20 2a 20 44 65 73 63 72 69 70 74 69 6f 6e 3a 20 52 65 76 65 72 73 65 20 61 20 str);..*.Description:.Reverse.a.
00a0 73 74 72 69 6e 67 0a 20 2a 20 53 6f 75 72 63 65 20 63 6f 64 65 3a 20 65 78 74 2f 73 74 61 6e 64 string..*.Source.code:.ext/stand
00c0 61 72 64 2f 73 74 72 69 6e 67 2e 63 0a 2a 2f 0a 0a 2f 2a 20 54 65 73 74 69 6e 67 20 73 74 72 72 ard/string.c.*/../*.Testing.strr
00e0 65 76 28 29 20 66 75 6e 63 74 69 6f 6e 20 77 69 74 68 20 76 61 72 69 6f 75 73 20 64 6f 75 62 6c ev().function.with.various.doubl
0100 65 20 71 75 6f 74 65 64 20 73 74 72 69 6e 67 73 20 66 6f 72 20 27 73 74 72 27 20 2a 2f 0a 0a 65 e.quoted.strings.for.'str'.*/..e
0120 63 68 6f 20 22 2a 2a 2a 20 54 65 73 74 69 6e 67 20 73 74 72 72 65 76 28 29 20 3a 20 77 69 74 68 cho."***.Testing.strrev().:.with
0140 20 76 61 72 69 6f 75 73 20 64 6f 75 62 6c 65 20 71 75 6f 74 65 64 20 73 74 72 69 6e 67 73 20 2a .various.double.quoted.strings.*
0160 2a 2a 5c 6e 22 3b 0a 24 73 74 72 20 3d 20 22 48 69 69 69 69 22 3b 0a 0a 24 73 74 72 69 6e 67 73 **\n";.$str.=."Hiiii";..$strings
0180 20 3d 20 61 72 72 61 79 28 0a 20 20 2f 2f 73 74 72 69 6e 67 73 20 63 6f 6e 74 61 69 6e 69 6e 67 .=.array(...//strings.containing
01a0 20 65 73 63 61 70 65 20 63 68 61 72 73 0a 20 20 22 68 65 6c 6c 6f 5c 5c 77 6f 72 6c 64 22 2c 0a .escape.chars..."hello\\world",.
01c0 20 20 22 68 65 6c 6c 6f 5c 24 77 6f 72 6c 64 22 2c 0a 20 20 22 5c 74 74 65 73 74 69 6e 67 5c 74 .."hello\$world",..."\ttesting\t
01e0 74 65 73 74 69 6e 67 5c 74 73 74 72 72 65 76 22 2c 0a 20 20 22 74 65 73 74 69 6e 67 5c 72 73 74 testing\tstrrev",..."testing\rst
0200 72 72 65 76 20 74 65 73 74 69 6e 67 20 73 74 72 72 65 76 22 2c 0a 20 20 22 74 65 73 74 69 6e 67 rrev.testing.strrev",..."testing
0220 5c 66 73 74 72 72 65 76 20 5c 66 20 74 65 73 74 69 6e 67 20 5c 6e 73 74 72 72 65 76 22 2c 0a 20 \fstrrev.\f.testing.\nstrrev",..
0240 20 22 5c 6e 74 65 73 74 69 6e 67 5c 6e 73 74 72 72 65 76 5c 6e 20 74 65 73 74 69 6e 67 20 5c 6e ."\ntesting\nstrrev\n.testing.\n
0260 20 73 74 72 72 65 76 22 2c 0a 20 20 22 75 73 69 6e 67 5c 76 76 65 72 74 69 63 61 6c 5c 76 74 61 .strrev",..."using\vvertical\vta
0280 62 22 2c 0a 0a 20 20 2f 2f 70 6f 6c 79 6e 64 72 6f 6d 65 20 73 74 72 69 6e 67 73 0a 20 20 22 48 b",....//polyndrome.strings..."H
02a0 65 6c 6c 6f 6f 6c 6c 65 48 22 2c 0a 20 20 22 61 62 61 62 61 62 61 62 61 62 61 62 61 22 2c 0a 0a elloolleH",..."ababababababa",..
02c0 20 20 2f 2f 6e 75 6d 65 72 69 63 20 2b 20 73 74 72 69 6e 67 73 0a 20 20 22 48 65 6c 6c 6f 31 32 ..//numeric.+.strings..."Hello12
02e0 33 22 2c 0a 20 20 22 31 32 33 48 65 6c 6c 6f 22 2c 0a 20 20 22 31 32 33 2e 33 34 48 65 6c 6c 6f 3",..."123Hello",..."123.34Hello
0300 22 2c 0a 20 20 22 48 65 6c 6c 6f 31 2e 32 33 34 22 2c 0a 20 20 22 31 32 33 48 65 6c 6c 6f 31 2e ",..."Hello1.234",..."123Hello1.
0320 32 33 34 22 2c 0a 0a 20 20 2f 2f 63 6f 6e 63 61 74 65 6e 61 74 65 64 20 73 74 72 69 6e 67 73 0a 234",....//concatenated.strings.
0340 20 20 22 48 65 6c 6c 6f 22 2e 63 68 72 28 30 29 2e 22 57 6f 72 6c 64 22 2c 0a 20 20 22 48 65 6c .."Hello".chr(0)."World",..."Hel
0360 6c 6f 22 2e 22 77 6f 72 6c 64 22 2c 0a 20 20 22 48 65 6c 6c 6f 22 2e 24 73 74 72 2c 0a 0a 20 20 lo"."world",..."Hello".$str,....
0380 2f 2f 73 74 72 69 6e 67 73 20 63 6f 6e 74 61 69 6e 69 6e 67 20 77 68 69 74 65 20 73 70 61 63 65 //strings.containing.white.space
03a0 73 0a 20 20 22 20 20 20 20 20 20 20 20 20 20 20 20 20 20 68 22 2c 0a 20 20 22 68 20 20 20 20 20 s..."..............h",..."h.....
03c0 20 20 20 20 20 20 20 20 20 22 2c 0a 20 20 22 20 20 20 20 20 20 68 20 20 20 20 20 20 20 20 22 2c .........",..."......h........",
03e0 0a 20 20 22 68 20 20 65 20 20 6c 20 20 6c 20 20 6f 20 20 22 2c 0a 0a 20 20 2f 2f 73 74 72 69 6e ..."h..e..l..l..o..",....//strin
0400 67 73 20 63 6f 6e 74 61 69 6e 69 6e 67 20 71 75 6f 74 65 73 0a 20 20 22 5c 68 65 6c 6c 6f 5c 27 gs.containing.quotes..."\hello\'
0420 77 6f 72 6c 64 22 2c 0a 20 20 22 68 65 6c 6c 6f 5c 22 77 6f 72 6c 64 22 2c 0a 0a 20 20 2f 2f 73 world",..."hello\"world",....//s
0440 70 65 63 69 61 6c 20 63 68 61 72 73 20 69 6e 20 73 74 72 69 6e 67 73 0a 20 20 22 74 40 40 23 24 pecial.chars.in.strings..."t@@#$
0460 25 20 25 74 65 73 74 20 5e 74 65 73 74 20 26 74 65 73 74 20 2a 74 65 73 74 20 2b 74 65 73 74 20 %.%test.^test.&test.*test.+test.
0480 2d 74 65 73 74 22 2c 0a 20 20 22 21 74 65 73 74 20 7e 74 65 73 74 20 60 74 65 73 74 60 20 3d 74 -test",..."!test.~test.`test`.=t
04a0 65 73 74 3d 20 40 74 65 73 74 40 74 65 73 74 2e 63 6f 6d 22 2c 0a 20 20 22 2f 74 65 73 74 2f 72 est=.@test@test.com",..."/test/r
04c0 5c 74 65 73 74 5c 73 74 72 72 65 76 5c 74 5c 5c 75 20 2f 75 75 2f 22 2c 0a 0a 20 20 2f 2f 6f 6e \test\strrev\t\\u./uu/",....//on
04e0 6c 79 20 73 70 65 63 69 61 6c 20 63 68 61 72 73 0a 20 20 22 21 40 23 24 25 5e 26 2a 28 29 5f 2b ly.special.chars..."!@#$%^&*()_+
0500 3d 2d 60 7e 22 0a 29 3b 0a 0a 24 63 6f 75 6e 74 20 3d 20 31 3b 0a 66 6f 72 28 20 24 69 6e 64 65 =-`~".);..$count.=.1;.for(.$inde
0520 78 20 3d 20 30 3b 20 24 69 6e 64 65 78 20 3c 20 63 6f 75 6e 74 28 24 73 74 72 69 6e 67 73 29 3b x.=.0;.$index.<.count($strings);
0540 20 24 69 6e 64 65 78 2b 2b 20 29 20 7b 0a 20 20 65 63 68 6f 20 22 5c 6e 2d 2d 20 49 74 65 72 61 .$index++.).{...echo."\n--.Itera
0560 74 69 6f 6e 20 24 63 6f 75 6e 74 20 2d 2d 5c 6e 22 3b 0a 20 20 76 61 72 5f 64 75 6d 70 28 20 73 tion.$count.--\n";...var_dump(.s
0580 74 72 72 65 76 28 24 73 74 72 69 6e 67 73 5b 24 69 6e 64 65 78 5d 29 20 29 3b 0a 20 20 24 63 6f trrev($strings[$index]).);...$co
05a0 75 6e 74 20 2b 2b 3b 0a 7d 0a 0a 65 63 68 6f 20 22 2a 2a 2a 20 44 6f 6e 65 20 2a 2a 2a 22 3b 0a unt.++;.}..echo."***.Done.***";.
05c0 3f 3e 0a 2d 2d 45 58 50 45 43 54 46 2d 2d 0a 2a 2a 2a 20 54 65 73 74 69 6e 67 20 73 74 72 72 65 ?>.--EXPECTF--.***.Testing.strre
05e0 76 28 29 20 3a 20 77 69 74 68 20 76 61 72 69 6f 75 73 20 64 6f 75 62 6c 65 20 71 75 6f 74 65 64 v().:.with.various.double.quoted
0600 20 73 74 72 69 6e 67 73 20 2a 2a 2a 0a 0a 2d 2d 20 49 74 65 72 61 74 69 6f 6e 20 31 20 2d 2d 0a .strings.***..--.Iteration.1.--.
0620 73 74 72 69 6e 67 28 31 31 29 20 22 64 6c 72 6f 77 5c 6f 6c 6c 65 68 22 0a 0a 2d 2d 20 49 74 65 string(11)."dlrow\olleh"..--.Ite
0640 72 61 74 69 6f 6e 20 32 20 2d 2d 0a 73 74 72 69 6e 67 28 31 31 29 20 22 64 6c 72 6f 77 24 6f 6c ration.2.--.string(11)."dlrow$ol
0660 6c 65 68 22 0a 0a 2d 2d 20 49 74 65 72 61 74 69 6f 6e 20 33 20 2d 2d 0a 73 74 72 69 6e 67 28 32 leh"..--.Iteration.3.--.string(2
0680 33 29 20 22 76 65 72 72 74 73 09 67 6e 69 74 73 65 74 09 67 6e 69 74 73 65 74 09 22 0a 0a 2d 2d 3)."verrts.gnitset.gnitset."..--
06a0 20 49 74 65 72 61 74 69 6f 6e 20 34 20 2d 2d 0a 73 74 72 69 6e 67 28 32 39 29 20 22 76 65 72 72 .Iteration.4.--.string(29)."verr
06c0 74 73 20 67 6e 69 74 73 65 74 20 76 65 72 72 74 73 0d 67 6e 69 74 73 65 74 22 0a 0a 2d 2d 20 49 ts.gnitset.verrts.gnitset"..--.I
06e0 74 65 72 61 74 69 6f 6e 20 35 20 2d 2d 0a 73 74 72 69 6e 67 28 33 32 29 20 22 76 65 72 72 74 73 teration.5.--.string(32)."verrts
0700 0a 20 67 6e 69 74 73 65 74 20 0c 20 76 65 72 72 74 73 0c 67 6e 69 74 73 65 74 22 0a 0a 2d 2d 20 ..gnitset...verrts.gnitset"..--.
0720 49 74 65 72 61 74 69 6f 6e 20 36 20 2d 2d 0a 73 74 72 69 6e 67 28 33 33 29 20 22 76 65 72 72 74 Iteration.6.--.string(33)."verrt
0740 73 20 0a 20 67 6e 69 74 73 65 74 20 0a 76 65 72 72 74 73 0a 67 6e 69 74 73 65 74 0a 22 0a 0a 2d s...gnitset..verrts.gnitset."..-
0760 2d 20 49 74 65 72 61 74 69 6f 6e 20 37 20 2d 2d 0a 73 74 72 69 6e 67 28 31 38 29 20 22 62 61 74 -.Iteration.7.--.string(18)."bat
0780 0b 6c 61 63 69 74 72 65 76 0b 67 6e 69 73 75 22 0a 0a 2d 2d 20 49 74 65 72 61 74 69 6f 6e 20 38 .lacitrev.gnisu"..--.Iteration.8
07a0 20 2d 2d 0a 73 74 72 69 6e 67 28 31 30 29 20 22 48 65 6c 6c 6f 6f 6c 6c 65 48 22 0a 0a 2d 2d 20 .--.string(10)."HelloolleH"..--.
07c0 49 74 65 72 61 74 69 6f 6e 20 39 20 2d 2d 0a 73 74 72 69 6e 67 28 31 33 29 20 22 61 62 61 62 61 Iteration.9.--.string(13)."ababa
07e0 62 61 62 61 62 61 62 61 22 0a 0a 2d 2d 20 49 74 65 72 61 74 69 6f 6e 20 31 30 20 2d 2d 0a 73 74 babababa"..--.Iteration.10.--.st
0800 72 69 6e 67 28 38 29 20 22 33 32 31 6f 6c 6c 65 48 22 0a 0a 2d 2d 20 49 74 65 72 61 74 69 6f 6e ring(8)."321olleH"..--.Iteration
0820 20 31 31 20 2d 2d 0a 73 74 72 69 6e 67 28 38 29 20 22 6f 6c 6c 65 48 33 32 31 22 0a 0a 2d 2d 20 .11.--.string(8)."olleH321"..--.
0840 49 74 65 72 61 74 69 6f 6e 20 31 32 20 2d 2d 0a 73 74 72 69 6e 67 28 31 31 29 20 22 6f 6c 6c 65 Iteration.12.--.string(11)."olle
0860 48 34 33 2e 33 32 31 22 0a 0a 2d 2d 20 49 74 65 72 61 74 69 6f 6e 20 31 33 20 2d 2d 0a 73 74 72 H43.321"..--.Iteration.13.--.str
0880 69 6e 67 28 31 30 29 20 22 34 33 32 2e 31 6f 6c 6c 65 48 22 0a 0a 2d 2d 20 49 74 65 72 61 74 69 ing(10)."432.1olleH"..--.Iterati
08a0 6f 6e 20 31 34 20 2d 2d 0a 73 74 72 69 6e 67 28 31 33 29 20 22 34 33 32 2e 31 6f 6c 6c 65 48 33 on.14.--.string(13)."432.1olleH3
08c0 32 31 22 0a 0a 2d 2d 20 49 74 65 72 61 74 69 6f 6e 20 31 35 20 2d 2d 0a 73 74 72 69 6e 67 28 31 21"..--.Iteration.15.--.string(1
08e0 31 29 20 22 64 6c 72 6f 57 00 6f 6c 6c 65 48 22 0a 0a 2d 2d 20 49 74 65 72 61 74 69 6f 6e 20 31 1)."dlroW.olleH"..--.Iteration.1
0900 36 20 2d 2d 0a 73 74 72 69 6e 67 28 31 30 29 20 22 64 6c 72 6f 77 6f 6c 6c 65 48 22 0a 0a 2d 2d 6.--.string(10)."dlrowolleH"..--
0920 20 49 74 65 72 61 74 69 6f 6e 20 31 37 20 2d 2d 0a 73 74 72 69 6e 67 28 31 30 29 20 22 69 69 69 .Iteration.17.--.string(10)."iii
0940 69 48 6f 6c 6c 65 48 22 0a 0a 2d 2d 20 49 74 65 72 61 74 69 6f 6e 20 31 38 20 2d 2d 0a 73 74 72 iHolleH"..--.Iteration.18.--.str
0960 69 6e 67 28 31 35 29 20 22 68 20 20 20 20 20 20 20 20 20 20 20 20 20 20 22 0a 0a 2d 2d 20 49 74 ing(15)."h.............."..--.It
0980 65 72 61 74 69 6f 6e 20 31 39 20 2d 2d 0a 73 74 72 69 6e 67 28 31 35 29 20 22 20 20 20 20 20 20 eration.19.--.string(15)."......
09a0 20 20 20 20 20 20 20 20 68 22 0a 0a 2d 2d 20 49 74 65 72 61 74 69 6f 6e 20 32 30 20 2d 2d 0a 73 ........h"..--.Iteration.20.--.s
09c0 74 72 69 6e 67 28 31 35 29 20 22 20 20 20 20 20 20 20 20 68 20 20 20 20 20 20 22 0a 0a 2d 2d 20 tring(15)."........h......"..--.
09e0 49 74 65 72 61 74 69 6f 6e 20 32 31 20 2d 2d 0a 73 74 72 69 6e 67 28 31 35 29 20 22 20 20 6f 20 Iteration.21.--.string(15)."..o.
0a00 20 6c 20 20 6c 20 20 65 20 20 68 22 0a 0a 2d 2d 20 49 74 65 72 61 74 69 6f 6e 20 32 32 20 2d 2d .l..l..e..h"..--.Iteration.22.--
0a20 0a 73 74 72 69 6e 67 28 31 33 29 20 22 64 6c 72 6f 77 27 5c 6f 6c 6c 65 68 5c 22 0a 0a 2d 2d 20 .string(13)."dlrow'\olleh\"..--.
0a40 49 74 65 72 61 74 69 6f 6e 20 32 33 20 2d 2d 0a 73 74 72 69 6e 67 28 31 31 29 20 22 64 6c 72 6f Iteration.23.--.string(11)."dlro
0a60 77 22 6f 6c 6c 65 68 22 0a 0a 2d 2d 20 49 74 65 72 61 74 69 6f 6e 20 32 34 20 2d 2d 0a 73 74 72 w"olleh"..--.Iteration.24.--.str
0a80 69 6e 67 28 34 32 29 20 22 74 73 65 74 2d 20 74 73 65 74 2b 20 74 73 65 74 2a 20 74 73 65 74 26 ing(42)."tset-.tset+.tset*.tset&
0aa0 20 74 73 65 74 5e 20 74 73 65 74 25 20 25 24 23 40 40 74 22 0a 0a 2d 2d 20 49 74 65 72 61 74 69 .tset^.tset%.%$#@@t"..--.Iterati
0ac0 6f 6e 20 32 35 20 2d 2d 0a 73 74 72 69 6e 67 28 34 30 29 20 22 6d 6f 63 2e 74 73 65 74 40 74 73 on.25.--.string(40)."moc.tset@ts
0ae0 65 74 40 20 3d 74 73 65 74 3d 20 60 74 73 65 74 60 20 74 73 65 74 7e 20 74 73 65 74 21 22 0a 0a et@.=tset=.`tset`.tset~.tset!"..
0b00 2d 2d 20 49 74 65 72 61 74 69 6f 6e 20 32 36 20 2d 2d 0a 73 74 72 69 6e 67 28 32 36 29 20 22 2f --.Iteration.26.--.string(26)."/
0b20 75 75 2f 20 75 5c 09 76 65 72 72 74 73 5c 74 73 65 09 72 2f 74 73 65 74 2f 22 0a 0a 2d 2d 20 49 uu/.u\.verrts\tse.r/tset/"..--.I
0b40 74 65 72 61 74 69 6f 6e 20 32 37 20 2d 2d 0a 73 74 72 69 6e 67 28 31 36 29 20 22 7e 60 2d 3d 2b teration.27.--.string(16)."~`-=+
0b60 5f 29 28 2a 26 5e 25 24 23 40 21 22 0a 2a 2a 2a 20 44 6f 6e 65 20 2a 2a 2a 0a _)(*&^%$#@!".***.Done.***.