1--TEST--
2Test addcslashes() function (variation 3)
3--INI--
4precision=14
5--FILE--
6<?php
7
8/* Miscellaneous input */
9echo "\n*** Testing addcslashes() with miscellaneous input arguments ***\n";
10var_dump( addcslashes("", "") );
11var_dump( addcslashes("", "burp") );
12var_dump( addcslashes("kaboemkara!", "") );
13var_dump( addcslashes("foobarbaz", 'bar') );
14var_dump( addcslashes('foo[ ]', 'A..z') );
15var_dump( @addcslashes("zoo['.']", 'z..A') );
16var_dump( addcslashes('abcdefghijklmnopqrstuvwxyz', "a\145..\160z") );
17var_dump( addcslashes( 123, 123 ) );
18var_dump( addcslashes( 123, NULL) );
19var_dump( addcslashes( NULL, 123) );
20var_dump( addcslashes( 0, 0 ) );
21var_dump( addcslashes( "\0" , 0 ) );
22var_dump( addcslashes( NULL, NULL) );
23var_dump( addcslashes( -1.234578, 3 ) );
24var_dump( addcslashes( " ", " ") );
25var_dump( addcslashes( "string\x00with\x00NULL", "\0") );
26
27echo "Done\n";
28
29?>
30--EXPECTF--
31*** Testing addcslashes() with miscellaneous input arguments ***
32string(0) ""
33string(0) ""
34string(11) "kaboemkara!"
35string(14) "foo\b\a\r\b\az"
36string(11) "\f\o\o\[ \]"
37string(10) "\zoo['\.']"
38string(40) "\abcd\e\f\g\h\i\j\k\l\m\n\o\pqrstuvwxy\z"
39string(6) "\1\2\3"
40string(3) "123"
41string(0) ""
42string(2) "\0"
43string(1) "�"
44string(0) ""
45string(10) "-1.2\34578"
46string(2) "\ "
47string(22) "string\000with\000NULL"
48Done
49