Annotation of embedaddon/php/ext/standard/tests/strings/addcslashes_002.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Test addcslashes() function (variation 2)
3: --INI--
4: precision=14
5: --FILE--
6: <?php
7:
8: $string = "goodyear12345NULL\0truefalse\a\v\f\b\n\r\t";
9: /* charlist "\0..\37" would escape all characters with ASCII code between 0 and 31 */
10: echo "\n*** Testing addcslashes() with ASCII code between 0 and 31 ***\n";
11: var_dump( addcslashes($string, "\0..\37") );
12:
13: /* Checking OBJECTS type */
14: echo "\n*** Testing addcslashes() with objects ***\n";
15: class string1
16: {
17: public function __toString() {
18: return "Object";
19: }
20: }
21: $obj = new string1;
22: var_dump( addcslashes($obj, "b") );
23:
24: echo "Done\n";
25:
26: ?>
27: --EXPECTF--
28: *** Testing addcslashes() with ASCII code between 0 and 31 ***
29: string(44) "goodyear12345NULL\000truefalse\a\v\f\b\n\r\t"
30:
31: *** Testing addcslashes() with objects ***
32: string(7) "O\bject"
33: Done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>