1--TEST--
2various magic quotes tests
3--INI--
4error_reporting=14335
5--FILE--
6<?php
7
8$filename = dirname(__FILE__)."/magic_quotes.dat";
9
10var_dump(get_magic_quotes_runtime());
11var_dump(get_magic_quotes_runtime("blah"));
12
13file_put_contents($filename, "some'content'here\"and}there");
14
15var_dump(set_magic_quotes_runtime(true));
16var_dump(get_magic_quotes_runtime());
17var_dump(set_magic_quotes_runtime(-1));
18var_dump(get_magic_quotes_runtime());
19
20var_dump(file_get_contents($filename));
21
22var_dump(set_magic_quotes_runtime(0));
23var_dump(get_magic_quotes_runtime());
24
25var_dump(file_get_contents($filename));
26
27var_dump(set_magic_quotes_runtime(1));
28var_dump(get_magic_quotes_runtime());
29
30file_put_contents($filename, "some'content'here\"and}there");
31
32var_dump(file_get_contents($filename));
33
34var_dump(set_magic_quotes_runtime(0));
35var_dump(set_magic_quotes_runtime());
36var_dump(get_magic_quotes_runtime());
37
38var_dump(file_get_contents($filename));
39
40
41@unlink($filename);
42
43echo "Done\n";
44?>
45--EXPECTF--
46int(0)
47int(0)
48
49Deprecated: Function set_magic_quotes_runtime() is deprecated in %s on line %d
50bool(true)
51int(1)
52
53Deprecated: Function set_magic_quotes_runtime() is deprecated in %s on line %d
54bool(true)
55int(1)
56string(30) "some\'content\'here\"and}there"
57
58Deprecated: Function set_magic_quotes_runtime() is deprecated in %s on line %d
59bool(true)
60int(0)
61string(27) "some'content'here"and}there"
62
63Deprecated: Function set_magic_quotes_runtime() is deprecated in %s on line %d
64bool(true)
65int(1)
66string(30) "some\'content\'here\"and}there"
67
68Deprecated: Function set_magic_quotes_runtime() is deprecated in %s on line %d
69bool(true)
70
71Deprecated: Function set_magic_quotes_runtime() is deprecated in %s on line %d
72
73Warning: set_magic_quotes_runtime() expects exactly 1 parameter, 0 given in %s on line %d
74NULL
75int(0)
76string(27) "some'content'here"and}there"
77Done
78