summaryrefslogtreecommitdiff
path: root/ext/standard/tests/strings/stripslashes_basic.phpt
blob: f1da924fee6784cccb0eea60d07107033d84eddc (plain)
ofshex dumpascii
0000 2d 2d 54 45 53 54 2d 2d 0a 54 65 73 74 20 73 74 72 69 70 73 6c 61 73 68 65 73 28 29 20 66 75 6e --TEST--.Test.stripslashes().fun
0020 63 74 69 6f 6e 20 3a 20 62 61 73 69 63 20 66 75 6e 63 74 69 6f 6e 61 6c 69 74 79 0a 2d 2d 46 49 ction.:.basic.functionality.--FI
0040 4c 45 2d 2d 0a 3c 3f 70 68 70 0a 2f 2a 0a 20 2a 20 54 65 73 74 69 6e 67 20 73 74 72 69 70 73 6c LE--.<?php./*..*.Testing.stripsl
0060 61 73 68 65 73 28 29 20 77 69 74 68 20 71 75 6f 74 65 64 20 73 74 72 69 6e 67 73 0a 2a 2f 0a 0a ashes().with.quoted.strings.*/..
0080 65 63 68 6f 20 22 2a 2a 2a 20 54 65 73 74 69 6e 67 20 73 74 72 69 70 73 6c 61 73 68 65 73 28 29 echo."***.Testing.stripslashes()
00a0 20 3a 20 62 61 73 69 63 20 66 75 6e 63 74 69 6f 6e 61 6c 69 74 79 20 2a 2a 2a 5c 6e 22 3b 0a 0a .:.basic.functionality.***\n";..
00c0 2f 2f 20 49 6e 69 74 69 61 6c 69 7a 65 20 61 6c 6c 20 72 65 71 75 69 72 65 64 20 76 61 72 69 61 //.Initialize.all.required.varia
00e0 62 6c 65 73 0a 24 73 74 72 5f 61 72 72 61 79 20 3d 20 61 72 72 61 79 28 20 22 48 6f 77 27 73 20 bles.$str_array.=.array(."How's.
0100 65 76 65 72 79 62 6f 64 79 22 2c 20 20 20 2f 2f 20 73 74 72 69 6e 67 20 63 6f 6e 74 61 69 6e 69 everybody",...//.string.containi
0120 6e 67 20 73 69 6e 67 6c 65 20 71 75 6f 74 65 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ng.single.quote.................
0140 20 20 20 20 27 41 72 65 20 79 6f 75 20 22 4a 4f 48 4e 22 3f 27 2c 20 20 20 2f 2f 20 73 74 72 69 ....'Are.you."JOHN"?',...//.stri
0160 6e 67 20 77 69 74 68 20 64 6f 75 62 6c 65 20 71 75 6f 74 65 73 0a 20 20 20 20 20 20 20 20 20 20 ng.with.double.quotes...........
0180 20 20 20 20 20 20 20 20 20 20 27 63 3a 5c 70 68 70 5c 73 74 72 69 70 73 6c 61 73 68 65 73 27 2c ..........'c:\php\stripslashes',
01a0 20 20 20 2f 2f 20 73 74 72 69 6e 67 20 77 69 74 68 20 62 61 63 6b 73 6c 61 73 68 65 73 0a 20 20 ...//.string.with.backslashes...
01c0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 27 63 3a 5c 5c 70 68 70 5c 5c 73 74 72 69 ..................'c:\\php\\stri
01e0 70 73 6c 61 73 68 65 73 27 2c 20 20 20 2f 2f 20 73 74 72 69 6e 67 20 77 69 74 68 20 64 6f 75 62 pslashes',...//.string.with.doub
0200 6c 65 20 62 61 63 6b 73 6c 61 73 68 65 73 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 le.backslashes..................
0220 20 20 20 22 68 65 6c 6c 6f 5c 30 77 6f 72 6c 64 22 20 20 20 2f 2f 20 73 74 72 69 6e 67 20 77 69 ..."hello\0world"...//.string.wi
0240 74 68 20 6e 75 6c 20 63 68 61 72 61 63 74 65 72 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 th.nul.character................
0260 20 20 20 29 3b 0a 0a 2f 2f 20 43 61 6c 6c 69 6e 67 20 73 74 72 69 70 6c 61 73 68 65 73 28 29 20 ...);..//.Calling.striplashes().
0280 77 69 74 68 20 61 6c 6c 20 61 72 67 75 6d 65 6e 74 73 0a 66 6f 72 65 61 63 68 28 20 24 73 74 72 with.all.arguments.foreach(.$str
02a0 5f 61 72 72 61 79 20 61 73 20 24 73 74 72 20 29 20 20 7b 0a 20 20 24 73 74 72 5f 61 64 64 73 6c _array.as.$str.)..{...$str_addsl
02c0 61 73 68 65 73 20 3d 20 61 64 64 73 6c 61 73 68 65 73 28 24 73 74 72 29 3b 0a 20 20 76 61 72 5f ashes.=.addslashes($str);...var_
02e0 64 75 6d 70 28 22 54 68 65 20 73 74 72 69 6e 67 20 61 66 74 65 72 20 61 64 64 73 6c 61 73 68 65 dump("The.string.after.addslashe
0300 73 20 69 73 3a 22 2c 20 24 73 74 72 5f 61 64 64 73 6c 61 73 68 65 73 29 3b 0a 20 20 24 73 74 72 s.is:",.$str_addslashes);...$str
0320 5f 73 74 72 69 70 73 6c 61 73 68 65 73 20 3d 20 73 74 72 69 70 73 6c 61 73 68 65 73 28 24 73 74 _stripslashes.=.stripslashes($st
0340 72 5f 61 64 64 73 6c 61 73 68 65 73 29 3b 0a 20 20 76 61 72 5f 64 75 6d 70 28 22 54 68 65 20 73 r_addslashes);...var_dump("The.s
0360 74 72 69 6e 67 20 61 66 74 65 72 20 73 74 72 69 70 73 6c 61 73 68 65 73 20 69 73 3a 22 2c 20 24 tring.after.stripslashes.is:",.$
0380 73 74 72 5f 73 74 72 69 70 73 6c 61 73 68 65 73 29 3b 0a 20 20 69 66 28 20 73 74 72 63 6d 70 28 str_stripslashes);...if(.strcmp(
03a0 24 73 74 72 2c 20 24 73 74 72 5f 73 74 72 69 70 73 6c 61 73 68 65 73 29 20 21 3d 20 30 20 29 0a $str,.$str_stripslashes).!=.0.).
03c0 20 20 20 20 65 63 68 6f 20 22 5c 6e 45 72 72 6f 72 3a 20 4f 72 69 67 69 6e 61 6c 20 73 74 72 69 ....echo."\nError:.Original.stri
03e0 6e 67 20 61 6e 64 20 73 74 72 69 6e 67 20 61 66 74 65 72 20 73 74 72 69 70 73 6c 61 73 68 65 73 ng.and.string.after.stripslashes
0400 20 64 6f 6e 6f 74 20 6d 61 74 63 68 5c 6e 22 3b 0a 7d 0a 0a 65 63 68 6f 20 22 44 6f 6e 65 5c 6e .donot.match\n";.}..echo."Done\n
0420 22 3b 0a 3f 3e 0a 2d 2d 45 58 50 45 43 54 2d 2d 0a 2a 2a 2a 20 54 65 73 74 69 6e 67 20 73 74 72 ";.?>.--EXPECT--.***.Testing.str
0440 69 70 73 6c 61 73 68 65 73 28 29 20 3a 20 62 61 73 69 63 20 66 75 6e 63 74 69 6f 6e 61 6c 69 74 ipslashes().:.basic.functionalit
0460 79 20 2a 2a 2a 0a 73 74 72 69 6e 67 28 33 31 29 20 22 54 68 65 20 73 74 72 69 6e 67 20 61 66 74 y.***.string(31)."The.string.aft
0480 65 72 20 61 64 64 73 6c 61 73 68 65 73 20 69 73 3a 22 0a 73 74 72 69 6e 67 28 31 36 29 20 22 48 er.addslashes.is:".string(16)."H
04a0 6f 77 5c 27 73 20 65 76 65 72 79 62 6f 64 79 22 0a 73 74 72 69 6e 67 28 33 33 29 20 22 54 68 65 ow\'s.everybody".string(33)."The
04c0 20 73 74 72 69 6e 67 20 61 66 74 65 72 20 73 74 72 69 70 73 6c 61 73 68 65 73 20 69 73 3a 22 0a .string.after.stripslashes.is:".
04e0 73 74 72 69 6e 67 28 31 35 29 20 22 48 6f 77 27 73 20 65 76 65 72 79 62 6f 64 79 22 0a 73 74 72 string(15)."How's.everybody".str
0500 69 6e 67 28 33 31 29 20 22 54 68 65 20 73 74 72 69 6e 67 20 61 66 74 65 72 20 61 64 64 73 6c 61 ing(31)."The.string.after.addsla
0520 73 68 65 73 20 69 73 3a 22 0a 73 74 72 69 6e 67 28 31 37 29 20 22 41 72 65 20 79 6f 75 20 5c 22 shes.is:".string(17)."Are.you.\"
0540 4a 4f 48 4e 5c 22 3f 22 0a 73 74 72 69 6e 67 28 33 33 29 20 22 54 68 65 20 73 74 72 69 6e 67 20 JOHN\"?".string(33)."The.string.
0560 61 66 74 65 72 20 73 74 72 69 70 73 6c 61 73 68 65 73 20 69 73 3a 22 0a 73 74 72 69 6e 67 28 31 after.stripslashes.is:".string(1
0580 35 29 20 22 41 72 65 20 79 6f 75 20 22 4a 4f 48 4e 22 3f 22 0a 73 74 72 69 6e 67 28 33 31 29 20 5)."Are.you."JOHN"?".string(31).
05a0 22 54 68 65 20 73 74 72 69 6e 67 20 61 66 74 65 72 20 61 64 64 73 6c 61 73 68 65 73 20 69 73 3a "The.string.after.addslashes.is:
05c0 22 0a 73 74 72 69 6e 67 28 32 31 29 20 22 63 3a 5c 5c 70 68 70 5c 5c 73 74 72 69 70 73 6c 61 73 ".string(21)."c:\\php\\stripslas
05e0 68 65 73 22 0a 73 74 72 69 6e 67 28 33 33 29 20 22 54 68 65 20 73 74 72 69 6e 67 20 61 66 74 65 hes".string(33)."The.string.afte
0600 72 20 73 74 72 69 70 73 6c 61 73 68 65 73 20 69 73 3a 22 0a 73 74 72 69 6e 67 28 31 39 29 20 22 r.stripslashes.is:".string(19)."
0620 63 3a 5c 70 68 70 5c 73 74 72 69 70 73 6c 61 73 68 65 73 22 0a 73 74 72 69 6e 67 28 33 31 29 20 c:\php\stripslashes".string(31).
0640 22 54 68 65 20 73 74 72 69 6e 67 20 61 66 74 65 72 20 61 64 64 73 6c 61 73 68 65 73 20 69 73 3a "The.string.after.addslashes.is:
0660 22 0a 73 74 72 69 6e 67 28 32 31 29 20 22 63 3a 5c 5c 70 68 70 5c 5c 73 74 72 69 70 73 6c 61 73 ".string(21)."c:\\php\\stripslas
0680 68 65 73 22 0a 73 74 72 69 6e 67 28 33 33 29 20 22 54 68 65 20 73 74 72 69 6e 67 20 61 66 74 65 hes".string(33)."The.string.afte
06a0 72 20 73 74 72 69 70 73 6c 61 73 68 65 73 20 69 73 3a 22 0a 73 74 72 69 6e 67 28 31 39 29 20 22 r.stripslashes.is:".string(19)."
06c0 63 3a 5c 70 68 70 5c 73 74 72 69 70 73 6c 61 73 68 65 73 22 0a 73 74 72 69 6e 67 28 33 31 29 20 c:\php\stripslashes".string(31).
06e0 22 54 68 65 20 73 74 72 69 6e 67 20 61 66 74 65 72 20 61 64 64 73 6c 61 73 68 65 73 20 69 73 3a "The.string.after.addslashes.is:
0700 22 0a 73 74 72 69 6e 67 28 31 32 29 20 22 68 65 6c 6c 6f 5c 30 77 6f 72 6c 64 22 0a 73 74 72 69 ".string(12)."hello\0world".stri
0720 6e 67 28 33 33 29 20 22 54 68 65 20 73 74 72 69 6e 67 20 61 66 74 65 72 20 73 74 72 69 70 73 6c ng(33)."The.string.after.stripsl
0740 61 73 68 65 73 20 69 73 3a 22 0a 73 74 72 69 6e 67 28 31 31 29 20 22 68 65 6c 6c 6f 00 77 6f 72 ashes.is:".string(11)."hello.wor
0760 6c 64 22 0a 44 6f 6e 65 0a ld".Done.