xref: /PHP-5.5/ext/dba/tests/dba_db4_010.phpt (revision 7b329d5a)
1--TEST--
2DBA DB4 magic_quotes_runtime Test
3--SKIPIF--
4<?php
5$handler = "db4";
6require_once(dirname(__FILE__) .'/skipif.inc');
7die("info $HND handler used");
8?>
9--FILE--
10<?php
11$handler = "db4";
12require_once(dirname(__FILE__) .'/test.inc');
13echo "database handler: $handler\n";
14if (($db_file=dba_open($db_file, "n", $handler))!==FALSE) {
15    ini_set('magic_quotes_runtime', 0);
16    dba_insert("key1", '"', $db_file);
17    var_dump(dba_fetch("key1", $db_file));
18    ini_set('magic_quotes_runtime', 1);
19    var_dump(dba_fetch("key1", $db_file));
20    dba_replace("key1", '\"', $db_file);
21    var_dump(dba_fetch("key1", $db_file));
22    ini_set('magic_quotes_runtime', 0);
23    var_dump(dba_fetch("key1", $db_file));
24    dba_close($db_file);
25} else {
26    echo "Error creating database\n";
27}
28?>
29--CLEAN--
30<?php
31require(dirname(__FILE__) .'/clean.inc');
32?>
33--EXPECTF--
34database handler: db4
35string(1) """
36string(2) "\""
37string(2) "\""
38string(1) """
39