2
Test xml_parser_set_option() function : usage variations
5
if (!extension_loaded("xml")) {
6
print "skip - XML extension not loaded";
11
/* Prototype : proto int xml_parser_set_option(resource parser, int option, mixed value)
12
* Description: Set options in an XML parser
13
* Source code: ext/xml/xml.c
17
echo "*** Testing xml_parser_set_option() : usage variations ***\n";
18
error_reporting(E_ALL & ~E_NOTICE);
21
function __toString() {
22
return "Some Ascii Data";
25
// Initialise function arguments not being substituted (if any)
28
//get an unset variable
32
$fp = fopen(__FILE__, "r");
34
//array of values to iterate over
55
array('color' => 'red', 'item' => 'pen'),
88
// loop through each element of the array for parser
90
foreach($values as $value) {
91
echo "\nArg value $value \n";
92
var_dump( xml_parser_set_option($value, $option, 1) );
99
*** Testing xml_parser_set_option() : usage variations ***
103
Warning: xml_parser_set_option() expects parameter 1 to be resource, integer given in %s on line %d
108
Warning: xml_parser_set_option() expects parameter 1 to be resource, integer given in %s on line %d
113
Warning: xml_parser_set_option() expects parameter 1 to be resource, integer given in %s on line %d
118
Warning: xml_parser_set_option() expects parameter 1 to be resource, integer given in %s on line %d
123
Warning: xml_parser_set_option() expects parameter 1 to be resource, double given in %s on line %d
128
Warning: xml_parser_set_option() expects parameter 1 to be resource, double given in %s on line %d
131
Arg value 101234567000
133
Warning: xml_parser_set_option() expects parameter 1 to be resource, double given in %s on line %d
136
Arg value 1.07654321E-9
138
Warning: xml_parser_set_option() expects parameter 1 to be resource, double given in %s on line %d
143
Warning: xml_parser_set_option() expects parameter 1 to be resource, double given in %s on line %d
148
Warning: xml_parser_set_option() expects parameter 1 to be resource, array given in %s on line %d
153
Warning: xml_parser_set_option() expects parameter 1 to be resource, array given in %s on line %d
158
Warning: xml_parser_set_option() expects parameter 1 to be resource, array given in %s on line %d
163
Warning: xml_parser_set_option() expects parameter 1 to be resource, array given in %s on line %d
168
Warning: xml_parser_set_option() expects parameter 1 to be resource, array given in %s on line %d
173
Warning: xml_parser_set_option() expects parameter 1 to be resource, null given in %s on line %d
178
Warning: xml_parser_set_option() expects parameter 1 to be resource, null given in %s on line %d
183
Warning: xml_parser_set_option() expects parameter 1 to be resource, boolean given in %s on line %d
188
Warning: xml_parser_set_option() expects parameter 1 to be resource, boolean given in %s on line %d
193
Warning: xml_parser_set_option() expects parameter 1 to be resource, boolean given in %s on line %d
198
Warning: xml_parser_set_option() expects parameter 1 to be resource, boolean given in %s on line %d
203
Warning: xml_parser_set_option() expects parameter 1 to be resource, string given in %s on line %d
208
Warning: xml_parser_set_option() expects parameter 1 to be resource, string given in %s on line %d
213
Warning: xml_parser_set_option() expects parameter 1 to be resource, string given in %s on line %d
218
Warning: xml_parser_set_option() expects parameter 1 to be resource, string given in %s on line %d
221
Arg value Some Ascii Data
223
Warning: xml_parser_set_option() expects parameter 1 to be resource, object given in %s on line %d
226
Arg value Resource id %s
228
Warning: xml_parser_set_option(): supplied resource is not a valid XML Parser resource in %s on line %d
233
Warning: xml_parser_set_option() expects parameter 1 to be resource, null given in %s on line %d
238
Warning: xml_parser_set_option() expects parameter 1 to be resource, null given in %s on line %d