import zend xml tests

Esse commit está contido em:
Paul Tarjan
2013-04-23 16:19:10 -07:00
commit de Sara Golemon
commit 51807939d1
164 arquivos alterados com 8249 adições e 1 exclusões
+7
Ver Arquivo
@@ -0,0 +1,7 @@
<?php
$sample = "<?xml version=\"1.0\"?><test attr=\"angle&lt;bracket\"/>";
$parser = xml_parser_create();
$res = xml_parse_into_struct($parser,$sample,$vals,$index);
xml_parser_free($parser);
var_dump($vals);
?>
@@ -0,0 +1,16 @@
array(1) {
[0]=>
array(4) {
["tag"]=>
string(4) "TEST"
["type"]=>
string(8) "complete"
["level"]=>
int(1)
["attributes"]=>
array(1) {
["ATTR"]=>
string(13) "angle<bracket"
}
}
}
@@ -0,0 +1,75 @@
<?php
/*
this test works fine with Expat but fails with libxml
which we now use as default
further investigation has shown that not only line count
is skippet on CDATA sections but that libxml does also
show different column numbers and byte positions depending
on context and in opposition to what one would expect to
see and what good old Expat reported just fine ...
*/
$xmls = array();
// Case 1: CDATA Sections
$xmls["CDATA"] ='<?xml version="1.0" encoding="iso-8859-1" ?>
<data>
<![CDATA[
multi
line
CDATA
block
]]>
</data>';
// Case 2: replace some characters so that we get comments instead
$xmls["Comment"] ='<?xml version="1.0" encoding="iso-8859-1" ?>
<data>
<!-- ATA[
multi
line
CDATA
block
-->
</data>';
// Case 3: replace even more characters so that only textual data is left
$xmls["Text"] ='<?xml version="1.0" encoding="iso-8859-1" ?>
<data>
-!-- ATA[
multi
line
CDATA
block
---
</data>';
function startElement($parser, $name, $attrs) {
printf("<$name> at line %d, col %d (byte %d)\n",
xml_get_current_line_number($parser),
xml_get_current_column_number($parser),
xml_get_current_byte_index($parser));
}
function endElement($parser, $name) {
printf("</$name> at line %d, col %d (byte %d)\n",
xml_get_current_line_number($parser),
xml_get_current_column_number($parser),
xml_get_current_byte_index($parser));
}
function characterData($parser, $data) {
// dummy
}
foreach ($xmls as $desc => $xml) {
echo "$desc\n";
$xml_parser = xml_parser_create();
xml_set_element_handler($xml_parser, "startElement", "endElement");
xml_set_character_data_handler($xml_parser, "characterData");
if (!xml_parse($xml_parser, $xml, true))
echo "Error: ".xml_error_string(xml_get_error_code($xml_parser))."\n";
xml_parser_free($xml_parser);
}
?>
@@ -0,0 +1,9 @@
CDATA
<DATA> at line 2, col %d (byte 9)
</DATA> at line 9, col %d (byte 56)
Comment
<DATA> at line 2, col %d (byte 9)
</DATA> at line 9, col %d (byte 56)
Text
<DATA> at line 2, col %d (byte 9)
</DATA> at line 9, col %d (byte 56)
+97
Ver Arquivo
@@ -0,0 +1,97 @@
<?php
class testcase {
private $encoding;
private $bom;
private $prologue;
private $tags;
private $chunk_size;
function testcase($enc, $chunk_size = 0, $bom = 0, $omit_prologue = 0) {
$this->encoding = $enc;
$this->chunk_size = $chunk_size;
$this->bom = $bom;
$this->prologue = !$omit_prologue;
$this->tags = array();
}
function start_element($parser, $name, $attrs) {
$attrs = array_map('bin2hex', $attrs);
$this->tags[] = bin2hex($name).": ".implode(', ', $attrs);
}
function end_element($parser, $name) {
}
function run() {
$data = '';
if ($this->prologue) {
$canonical_name = preg_replace('/BE|LE/i', '', $this->encoding);
$data .= "<?xml version=\"1.0\" encoding=\"$canonical_name\" ?>\n";
}
$data .= <<<HERE
<テスト:テスト1 xmlns:テスト="http://www.example.com/テスト/" テスト="テスト">
<テスト:テスト2 テスト="テスト">
<テスト:テスト3>
test!
</テスト:テスト3>
</テスト:テスト2>
</テスト:テスト1>
HERE;
$data = iconv("UTF-8", $this->encoding, $data);
$parser = xml_parser_create(NULL);
xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0);
xml_set_element_handler($parser, "start_element", "end_element");
xml_set_object($parser, $this);
if ($this->chunk_size == 0) {
$success = @xml_parse($parser, $data, true);
} else {
for ($offset = 0; $offset < strlen($data);
$offset += $this->chunk_size) {
$success = @xml_parse($parser, substr($data, $offset, $this->chunk_size), false);
if (!$success) {
break;
}
}
if ($success) {
$success = @xml_parse($parser, "", true);
}
}
echo "Encoding: $this->encoding\n";
echo "XML Prologue: ".($this->prologue ? 'present': 'not present'), "\n";
echo "Chunk size: ".($this->chunk_size ? "$this->chunk_size byte(s)\n": "all data at once\n");
echo "BOM: ".($this->bom ? 'prepended': 'not prepended'), "\n";
if ($success) {
var_dump($this->tags);
} else {
echo "[Error] ", xml_error_string(xml_get_error_code($parser)), "\n";
}
}
}
$suite = array(
new testcase("EUC-JP" , 0),
new testcase("EUC-JP" , 1),
new testcase("Shift_JIS", 0),
new testcase("Shift_JIS", 1),
new testcase("GB2312", 0),
new testcase("GB2312", 1),
);
if (XML_SAX_IMPL == 'libxml') {
echo "libxml2 Version => " . LIBXML_DOTTED_VERSION. "\n";
} else {
echo "libxml2 Version => NONE\n";
}
foreach ($suite as $testcase) {
$testcase->run();
}
// vim600: sts=4 sw=4 ts=4 encoding=UTF-8
?>
@@ -0,0 +1,73 @@
libxml2 Version => %s
Encoding: EUC-JP
XML Prologue: present
Chunk size: all data at once
BOM: not prepended
array(3) {
[0]=>
string(128) "e38386e382b9e383883ae38386e382b9e3838831: 687474703a2f2f7777772e6578616d706c652e636f6d2fe38386e382b9e383882f, e38386e382b9e38388"
[1]=>
string(60) "e38386e382b9e383883ae38386e382b9e3838832: e38386e382b9e38388"
[2]=>
string(42) "e38386e382b9e383883ae38386e382b9e3838833: "
}
Encoding: EUC-JP
XML Prologue: present
Chunk size: 1 byte(s)
BOM: not prepended
array(3) {
[0]=>
string(128) "e38386e382b9e383883ae38386e382b9e3838831: 687474703a2f2f7777772e6578616d706c652e636f6d2fe38386e382b9e383882f, e38386e382b9e38388"
[1]=>
string(60) "e38386e382b9e383883ae38386e382b9e3838832: e38386e382b9e38388"
[2]=>
string(42) "e38386e382b9e383883ae38386e382b9e3838833: "
}
Encoding: Shift_JIS
XML Prologue: present
Chunk size: all data at once
BOM: not prepended
array(3) {
[0]=>
string(128) "e38386e382b9e383883ae38386e382b9e3838831: 687474703a2f2f7777772e6578616d706c652e636f6d2fe38386e382b9e383882f, e38386e382b9e38388"
[1]=>
string(60) "e38386e382b9e383883ae38386e382b9e3838832: e38386e382b9e38388"
[2]=>
string(42) "e38386e382b9e383883ae38386e382b9e3838833: "
}
Encoding: Shift_JIS
XML Prologue: present
Chunk size: 1 byte(s)
BOM: not prepended
array(3) {
[0]=>
string(128) "e38386e382b9e383883ae38386e382b9e3838831: 687474703a2f2f7777772e6578616d706c652e636f6d2fe38386e382b9e383882f, e38386e382b9e38388"
[1]=>
string(60) "e38386e382b9e383883ae38386e382b9e3838832: e38386e382b9e38388"
[2]=>
string(42) "e38386e382b9e383883ae38386e382b9e3838833: "
}
Encoding: GB2312
XML Prologue: present
Chunk size: all data at once
BOM: not prepended
array(3) {
[0]=>
string(128) "e38386e382b9e383883ae38386e382b9e3838831: 687474703a2f2f7777772e6578616d706c652e636f6d2fe38386e382b9e383882f, e38386e382b9e38388"
[1]=>
string(60) "e38386e382b9e383883ae38386e382b9e3838832: e38386e382b9e38388"
[2]=>
string(42) "e38386e382b9e383883ae38386e382b9e3838833: "
}
Encoding: GB2312
XML Prologue: present
Chunk size: 1 byte(s)
BOM: not prepended
array(3) {
[0]=>
string(128) "e38386e382b9e383883ae38386e382b9e3838831: 687474703a2f2f7777772e6578616d706c652e636f6d2fe38386e382b9e383882f, e38386e382b9e38388"
[1]=>
string(60) "e38386e382b9e383883ae38386e382b9e3838832: e38386e382b9e38388"
[2]=>
string(42) "e38386e382b9e383883ae38386e382b9e3838833: "
}
+20
Ver Arquivo
@@ -0,0 +1,20 @@
<?php
$data = <<<END_OF_XML
\xEF\xBB\xBF<?xml version="1.0" encoding="utf-8"?\x3e
<!DOCTYPE bundle [
<!ELEMENT bundle (resource)+>
<!ELEMENT resource (#PCDATA)>
<!ATTLIST resource
key CDATA #REQUIRED
type (literal|pattern|sub) "literal"
>
]>
<resource key="rSeeYou">A bient&amp;244;t</resource>
END_OF_XML;
$parser = xml_parser_create_ns('UTF-8');
xml_parser_set_option($parser,XML_OPTION_CASE_FOLDING,0);
$result = xml_parse_into_struct($parser, $data, $vals, $index);
xml_parser_free($parser);
var_dump($vals);
?>
@@ -0,0 +1,20 @@
array(1) {
[0]=>
array(5) {
["tag"]=>
string(8) "resource"
["type"]=>
string(8) "complete"
["level"]=>
int(1)
["attributes"]=>
array(2) {
["key"]=>
string(7) "rSeeYou"
["type"]=>
string(7) "literal"
}
["value"]=>
string(13) "A bient&244;t"
}
}
+20
Ver Arquivo
@@ -0,0 +1,20 @@
<?php
function defaultfunc($parser, $data)
{
echo $data;
}
$xml = <<<HERE
<a xmlns="http://example.com/foo"
xmlns:bar="http://example.com/bar">
<bar:b foo="bar">1</bar:b>
<bar:c bar:nix="null" foo="bar">2</bar:c>
</a>
HERE;
$parser = xml_parser_create_ns("ISO-8859-1","@");
xml_set_default_handler($parser,'defaultfunc');
xml_parser_set_option($parser,XML_OPTION_CASE_FOLDING,0);
xml_parse($parser, $xml);
xml_parser_free($parser);
?>
@@ -0,0 +1,4 @@
<a xmlns="http://example.com/foo" xmlns:bar="http://example.com/bar">
<bar:b foo="bar">1</bar:b>
<bar:c bar:nix="null" foo="bar">2</bar:c>
</a>
+11
Ver Arquivo
@@ -0,0 +1,11 @@
<?php
$tests = array(
"\x41\xC2\x3E\x42",
"\xE3\x80\x22",
"\x41\x98\xBA\x42\xE2\x98\x43\xE2\x98\xBA\xE2\x98",
);
foreach ($tests as $t) {
echo bin2hex(utf8_decode($t)), "\n";
}
echo "Done.\n";
@@ -0,0 +1,4 @@
413f3e42
3f22
413f3f423f433f3f
Done.
+29
Ver Arquivo
@@ -0,0 +1,29 @@
<?php
$XML = <<<XML
<?xml version="1.0"?>
<ns1:listOfAwards xmlns:ns1="http://www.fpdsng.com/FPDS">
<ns1:count>
<ns1:total>867</ns1:total>
</ns1:count>
</ns1:listOfAwards>
XML;
$xml_parser = xml_parser_create();
xml_parser_set_option($xml_parser, XML_OPTION_SKIP_TAGSTART, 4);
xml_parse_into_struct($xml_parser, $XML, $vals, $index);
echo 'Index array' . PHP_EOL;
print_r($index);
echo 'Vals array' . PHP_EOL;
print_r($vals);
xml_parser_free($xml_parser);
function startElement($parser, $name, $attribs) { echo $name . PHP_EOL; }
function endElement($parser, $name) { echo $name . PHP_EOL; }
$xml_parser = xml_parser_create();
xml_set_element_handler($xml_parser, 'startElement', 'endElement');
xml_parser_set_option($xml_parser, XML_OPTION_SKIP_TAGSTART, 4);
xml_parse($xml_parser, $XML);
xml_parser_free($xml_parser);
?>
@@ -0,0 +1,96 @@
Index array
Array
(
[LISTOFAWARDS] => Array
(
[0] => 0
[1] => 5
[2] => 6
)
[COUNT] => Array
(
[0] => 1
[1] => 3
[2] => 4
)
[TOTAL] => Array
(
[0] => 2
)
)
Vals array
Array
(
[0] => Array
(
[tag] => LISTOFAWARDS
[type] => open
[level] => 1
[attributes] => Array
(
[XMLNS:NS1] => http://www.fpdsng.com/FPDS
)
[value] =>
)
[1] => Array
(
[tag] => COUNT
[type] => open
[level] => 2
[value] =>
)
[2] => Array
(
[tag] => TOTAL
[type] => complete
[level] => 3
[value] => 867
)
[3] => Array
(
[tag] => COUNT
[value] =>
[type] => cdata
[level] => 2
)
[4] => Array
(
[tag] => COUNT
[type] => close
[level] => 2
)
[5] => Array
(
[tag] => LISTOFAWARDS
[value] =>
[type] => cdata
[level] => 1
)
[6] => Array
(
[tag] => LISTOFAWARDS
[type] => close
[level] => 1
)
)
LISTOFAWARDS
COUNT
TOTAL
TOTAL
COUNT
LISTOFAWARDS
+11
Ver Arquivo
@@ -0,0 +1,11 @@
<?php
class UberSimpleXML extends SimpleXMLElement {
public function __toString() {
return 'stringification';
}
}
$xml = new UberSimpleXML('<xml/>');
var_dump((string) $xml);
var_dump($xml->__toString());
@@ -0,0 +1,2 @@
string(15) "stringification"
string(15) "stringification"
@@ -0,0 +1,78 @@
<?php
/* Prototype : proto string utf8_decode(string data)
* Description: Converts a UTF-8 encoded string to ISO-8859-1
* Source code: ext/xml/xml.c
* Alias to functions:
*/
echo "*** Testing utf8_decode() : usage variations ***\n";
error_reporting(E_ALL & ~E_NOTICE);
class aClass {
function __toString() {
return "Some Ascii Data";
}
}
// Initialise function arguments not being substituted (if any)
//get an unset variable
$unset_var = 10;
unset ($unset_var);
//array of values to iterate over
$values = array(
// int data
0,
1,
12345,
-2345,
// float data
10.5,
-10.5,
10.1234567e10,
10.7654321E-10,
.5,
// array data
array(),
array(0),
array(1),
array(1, 2),
array('color' => 'red', 'item' => 'pen'),
// null data
NULL,
null,
// boolean data
true,
false,
TRUE,
FALSE,
// empty data
"",
'',
// object data
new aClass(),
// undefined data
$undefined_var,
// unset data
$unset_var,
);
// loop through each element of the array for data
foreach($values as $value) {
echo @"\nArg value $value \n";
var_dump( utf8_decode($value) );
};
echo "Done";
?>
@@ -0,0 +1,82 @@
*** Testing utf8_decode() : usage variations ***
Arg value 0
string(1) "0"
Arg value 1
string(1) "1"
Arg value 12345
string(5) "12345"
Arg value -2345
string(5) "-2345"
Arg value 10.5
string(4) "10.5"
Arg value -10.5
string(5) "-10.5"
Arg value 101234567000
string(12) "101234567000"
Arg value 1.07654321E-9
string(13) "1.07654321E-9"
Arg value 0.5
string(3) "0.5"
Arg value Array
HipHop Warning: %a
NULL
Arg value Array
HipHop Warning: %a
NULL
Arg value Array
HipHop Warning: %a
NULL
Arg value Array
HipHop Warning: %a
NULL
Arg value Array
HipHop Warning: %a
NULL
Arg value
string(0) ""
Arg value
string(0) ""
Arg value 1
string(1) "1"
Arg value
string(0) ""
Arg value 1
string(1) "1"
Arg value
string(0) ""
Arg value
string(0) ""
Arg value
string(0) ""
Arg value Some Ascii Data
string(15) "Some Ascii Data"
Arg value
string(0) ""
Arg value
string(0) ""
Done
@@ -0,0 +1,78 @@
<?php
/* Prototype : proto string utf8_encode(string data)
* Description: Encodes an ISO-8859-1 string to UTF-8
* Source code: ext/xml/xml.c
* Alias to functions:
*/
echo "*** Testing utf8_encode() : usage variations ***\n";
error_reporting(E_ALL & ~E_NOTICE);
class aClass {
function __toString() {
return "Some Ascii Data";
}
}
// Initialise function arguments not being substituted (if any)
//get an unset variable
$unset_var = 10;
unset ($unset_var);
//array of values to iterate over
$values = array(
// int data
0,
1,
12345,
-2345,
// float data
10.5,
-10.5,
10.1234567e10,
10.7654321E-10,
.5,
// array data
array(),
array(0),
array(1),
array(1, 2),
array('color' => 'red', 'item' => 'pen'),
// null data
NULL,
null,
// boolean data
true,
false,
TRUE,
FALSE,
// empty data
"",
'',
// object data
new aClass(),
// undefined data
$undefined_var,
// unset data
$unset_var,
);
// loop through each element of the array for data
foreach($values as $value) {
echo @"\nArg value $value \n";
var_dump( utf8_encode($value) );
};
echo "Done";
?>
@@ -0,0 +1,82 @@
*** Testing utf8_encode() : usage variations ***
Arg value 0
string(1) "0"
Arg value 1
string(1) "1"
Arg value 12345
string(5) "12345"
Arg value -2345
string(5) "-2345"
Arg value 10.5
string(4) "10.5"
Arg value -10.5
string(5) "-10.5"
Arg value 101234567000
string(12) "101234567000"
Arg value 1.07654321E-9
string(13) "1.07654321E-9"
Arg value 0.5
string(3) "0.5"
Arg value Array
HipHop Warning: %a
NULL
Arg value Array
HipHop Warning: %a
NULL
Arg value Array
HipHop Warning: %a
NULL
Arg value Array
HipHop Warning: %a
NULL
Arg value Array
HipHop Warning: %a
NULL
Arg value
string(0) ""
Arg value
string(0) ""
Arg value 1
string(1) "1"
Arg value
string(0) ""
Arg value 1
string(1) "1"
Arg value
string(0) ""
Arg value
string(0) ""
Arg value
string(0) ""
Arg value Some Ascii Data
string(15) "Some Ascii Data"
Arg value
string(0) ""
Arg value
string(0) ""
Done
+67
Ver Arquivo
@@ -0,0 +1,67 @@
<?php
chdir(dirname(__FILE__));
$xml_parser = xml_parser_create();
xml_parser_set_option($xml_parser, XML_OPTION_CASE_FOLDING, 1);
xml_set_element_handler($xml_parser, "startElement", "endElement");
xml_set_character_data_handler($xml_parser, "characterData");
xml_set_processing_instruction_handler($xml_parser, "PIHandler");
xml_set_default_handler($xml_parser, "defaultHandler");
xml_set_external_entity_ref_handler($xml_parser, "externalEntityRefHandler");
if (!($fp = @fopen("xmltest.xml", "r"))) {
die("could not open XML input");
}
while ($data = fread($fp, 4096)) {
if (!xml_parse($xml_parser, $data, feof($fp))) {
die(sprintf("XML error: %s at line %d\n",
xml_error_string(xml_get_error_code($xml_parser)),
xml_get_current_line_number($xml_parser)));
}
}
print "parse complete\n";
xml_parser_free($xml_parser);
function startElement($parser, $name, $attribs)
{
print '{'.$name;
if (sizeof($attribs)) {
while (list($k, $v) = each($attribs)) {
print " $k=\"$v\"";
}
}
print '}';
}
function endElement($parser, $name)
{
print '{/'.$name.'}';
}
function characterData($parser, $data)
{
print '{CDATA['.$data.']}';
}
function PIHandler($parser, $target, $data)
{
print '{PI['.$target.','.$data.']}';
}
function defaultHandler($parser, $data)
{
if (substr($data, 0, 1) == "&" && substr($data, -1, 1) == ";") {
print '{ENTREF['.$data.']}';
} else {
print '{?['.$data.']}';
}
}
function externalEntityRefHandler($parser, $openEntityNames, $base, $systemId, $publicId)
{
print '{EXTENTREF['.$openEntityNames.','.$base.','.$systemId.','.$publicId."]}\n";
return true;
}
?>
@@ -0,0 +1,21 @@
{?[<?xml version="1.0" encoding="ISO-8859-1"?>]}{?[
]}{?[<!DOCTYPE]}{?[ ]}{?[phptest]}{?[ ]}{?[SYSTEM]}{?[ ]}{?["notfound.dtd"]}{?[ ]}{?[[]}{?[
]}{?[<!ENTITY]}{?[ ]}{?[%]}{?[ ]}{?[incent]}{?[ ]}{?[SYSTEM]}{?[ ]}{?["inc.ent"]}{?[>]}{?[
]}{?[%incent;]}{?[
]}{?[]]}{?[>]}{?[
]}{ROOT ID="elem1"}{CDATA[
]}{CDATA[ Plain text.]}{CDATA[
]}{CDATA[ ]}{ELEM1}{CDATA[
]}{CDATA[ ]}{?[<!-- comment -->]}{CDATA[
]}{CDATA[ ]}{ELEM2}{CDATA[
]}{CDATA[ ]}{?[<![CDATA[]}{CDATA[CDATA block]}{?[]]>]}{CDATA[
]}{CDATA[ ]}{ELEM3}{CDATA[
]}{CDATA[ ]}{ENTREF[&included-entity;]}{CDATA[
]}{CDATA[ ]}{ELEM4}{CDATA[
]}{CDATA[ ]}{PI[test,processing instruction ]}{CDATA[
]}{CDATA[ ]}{/ELEM4}{CDATA[
]}{CDATA[ ]}{/ELEM3}{CDATA[
]}{CDATA[ ]}{/ELEM2}{CDATA[
]}{CDATA[ ]}{/ELEM1}{CDATA[
]}{/ROOT}{?[
]}parse complete
+68
Ver Arquivo
@@ -0,0 +1,68 @@
<?php
chdir(dirname(__FILE__));
class myclass
{
function startElement($parser, $name, $attribs)
{
print '{'.$name;
if (sizeof($attribs)) {
while (list($k, $v) = each($attribs)) {
print " $k=\"$v\"";
}
}
print '}';
}
function endElement($parser, $name)
{
print '{/'.$name.'}';
}
function characterData($parser, $data)
{
print '{CDATA['.$data.']}';
}
function PIHandler($parser, $target, $data)
{
print '{PI['.$target.','.$data.']}';
}
function defaultHandler($parser, $data)
{
if (substr($data, 0, 1) == "&" && substr($data, -1, 1) == ";") {
print '{ENTREF['.$data.']}';
} else {
print '{?['.$data.']}';
}
}
function externalEntityRefHandler($parser, $openEntityNames, $base, $systemId, $publicId)
{
print '{EXTENTREF['.$openEntityNames.','.$base.','.$systemId.','.$publicId."]}\n";
return true;
}
}
$xml_parser = xml_parser_create();
$obj = new myclass;
xml_parser_set_option($xml_parser, XML_OPTION_CASE_FOLDING, 1);
xml_set_element_handler($xml_parser, array($obj,"startElement"),
array($obj, "endElement"));
xml_set_character_data_handler($xml_parser, array($obj, "characterData"));
xml_set_processing_instruction_handler($xml_parser, array($obj, "PIHandler"));
xml_set_default_handler($xml_parser, array($obj, "defaultHandler"));
xml_set_external_entity_ref_handler($xml_parser,
array($obj, "externalEntityRefHandler"));
if (!($fp = @fopen("xmltest.xml", "r"))) {
die("could not open XML input");
}
while ($data = fread($fp, 4096)) {
if (!xml_parse($xml_parser, $data, feof($fp))) {
die(sprintf("XML error: %s at line %d\n",
xml_error_string(xml_get_error_code($xml_parser)),
xml_get_current_line_number($xml_parser)));
}
}
print "parse complete\n";
xml_parser_free($xml_parser);
?>
@@ -0,0 +1,21 @@
{?[<?xml version="1.0" encoding="ISO-8859-1"?>]}{?[
]}{?[<!DOCTYPE]}{?[ ]}{?[phptest]}{?[ ]}{?[SYSTEM]}{?[ ]}{?["notfound.dtd"]}{?[ ]}{?[[]}{?[
]}{?[<!ENTITY]}{?[ ]}{?[%]}{?[ ]}{?[incent]}{?[ ]}{?[SYSTEM]}{?[ ]}{?["inc.ent"]}{?[>]}{?[
]}{?[%incent;]}{?[
]}{?[]]}{?[>]}{?[
]}{ROOT ID="elem1"}{CDATA[
]}{CDATA[ Plain text.]}{CDATA[
]}{CDATA[ ]}{ELEM1}{CDATA[
]}{CDATA[ ]}{?[<!-- comment -->]}{CDATA[
]}{CDATA[ ]}{ELEM2}{CDATA[
]}{CDATA[ ]}{?[<![CDATA[]}{CDATA[CDATA block]}{?[]]>]}{CDATA[
]}{CDATA[ ]}{ELEM3}{CDATA[
]}{CDATA[ ]}{ENTREF[&included-entity;]}{CDATA[
]}{CDATA[ ]}{ELEM4}{CDATA[
]}{CDATA[ ]}{PI[test,processing instruction ]}{CDATA[
]}{CDATA[ ]}{/ELEM4}{CDATA[
]}{CDATA[ ]}{/ELEM3}{CDATA[
]}{CDATA[ ]}{/ELEM2}{CDATA[
]}{CDATA[ ]}{/ELEM1}{CDATA[
]}{/ROOT}{?[
]}parse complete
+66
Ver Arquivo
@@ -0,0 +1,66 @@
<?php
chdir(dirname(__FILE__));
class myclass
{
function startElement($parser, $name, $attribs)
{
print '{'.$name;
if (sizeof($attribs)) {
while (list($k, $v) = each($attribs)) {
print " $k=\"$v\"";
}
}
print '}';
}
function endElement($parser, $name)
{
print '{/'.$name.'}';
}
function characterData($parser, $data)
{
print '{CDATA['.$data.']}';
}
function PIHandler($parser, $target, $data)
{
print '{PI['.$target.','.$data.']}';
}
function defaultHandler($parser, $data)
{
if (substr($data, 0, 1) == "&" && substr($data, -1, 1) == ";") {
print '{ENTREF['.$data.']}';
} else {
print '{?['.$data.']}';
}
}
function externalEntityRefHandler($parser, $openEntityNames, $base, $systemId, $publicId)
{
print '{EXTENTREF['.$openEntityNames.','.$base.','.$systemId.','.$publicId."]}\n";
return true;
}
}
$xml_parser = xml_parser_create();
$obj = new myclass;
xml_set_object($xml_parser, $obj);
xml_parser_set_option($xml_parser, XML_OPTION_CASE_FOLDING, 1);
xml_set_element_handler($xml_parser, "startElement", "endElement");
xml_set_character_data_handler($xml_parser, "characterData");
xml_set_processing_instruction_handler($xml_parser, "PIHandler");
xml_set_default_handler($xml_parser, "defaultHandler");
xml_set_external_entity_ref_handler($xml_parser, "externalEntityRefHandler");
if (!($fp = @fopen("xmltest.xml", "r"))) {
die("could not open XML input");
}
while ($data = fread($fp, 4096)) {
if (!xml_parse($xml_parser, $data, feof($fp))) {
die(sprintf("XML error: %s at line %d\n",
xml_error_string(xml_get_error_code($xml_parser)),
xml_get_current_line_number($xml_parser)));
}
}
print "parse complete\n";
xml_parser_free($xml_parser);
?>
@@ -0,0 +1,21 @@
{?[<?xml version="1.0" encoding="ISO-8859-1"?>]}{?[
]}{?[<!DOCTYPE]}{?[ ]}{?[phptest]}{?[ ]}{?[SYSTEM]}{?[ ]}{?["notfound.dtd"]}{?[ ]}{?[[]}{?[
]}{?[<!ENTITY]}{?[ ]}{?[%]}{?[ ]}{?[incent]}{?[ ]}{?[SYSTEM]}{?[ ]}{?["inc.ent"]}{?[>]}{?[
]}{?[%incent;]}{?[
]}{?[]]}{?[>]}{?[
]}{ROOT ID="elem1"}{CDATA[
]}{CDATA[ Plain text.]}{CDATA[
]}{CDATA[ ]}{ELEM1}{CDATA[
]}{CDATA[ ]}{?[<!-- comment -->]}{CDATA[
]}{CDATA[ ]}{ELEM2}{CDATA[
]}{CDATA[ ]}{?[<![CDATA[]}{CDATA[CDATA block]}{?[]]>]}{CDATA[
]}{CDATA[ ]}{ELEM3}{CDATA[
]}{CDATA[ ]}{ENTREF[&included-entity;]}{CDATA[
]}{CDATA[ ]}{ELEM4}{CDATA[
]}{CDATA[ ]}{PI[test,processing instruction ]}{CDATA[
]}{CDATA[ ]}{/ELEM4}{CDATA[
]}{CDATA[ ]}{/ELEM3}{CDATA[
]}{CDATA[ ]}{/ELEM2}{CDATA[
]}{CDATA[ ]}{/ELEM1}{CDATA[
]}{/ROOT}{?[
]}parse complete
+17
Ver Arquivo
@@ -0,0 +1,17 @@
<?php
function startHandler($parser,$tag,$attr)
{
var_dump($tag,$attr);
}
function endHandler($parser,$tag)
{
var_dump($tag);
}
$xmldata = '<?xml version="1.0" encoding="ISO-8859-1"?><äöü üäß="Üäß">ÄÖÜ</äöü>';
$parser = xml_parser_create('ISO-8859-1');
xml_set_element_handler($parser, "startHandler", "endHandler");
xml_parse_into_struct($parser, $xmldata, $struct, $index);
var_dump($struct);
?>
@@ -0,0 +1,24 @@
string(3) "ÄÖÜ"
array(1) {
["ÜÄß"]=>
string(3) "Üäß"
}
string(3) "ÄÖÜ"
array(1) {
[0]=>
array(5) {
["tag"]=>
string(3) "ÄÖÜ"
["type"]=>
string(8) "complete"
["level"]=>
int(1)
["attributes"]=>
array(1) {
["ÜÄß"]=>
string(3) "Üäß"
}
["value"]=>
string(3) "ÄÖÜ"
}
}
+27
Ver Arquivo
@@ -0,0 +1,27 @@
<?php
function start_elem($parser,$name,$attribs) {
print "$name ";
foreach($attribs as $key => $value) {
print "$key = $value ";
}
print "\n";
}
function end_elem()
{
}
$xml = <<<HERE
<a xmlns="http://example.com/foo"
xmlns:bar="http://example.com/bar">
<bar:b foo="bar"/>
<bar:c bar:nix="null" foo="bar"/>
</a>
HERE;
$parser = xml_parser_create_ns("ISO-8859-1","@");
xml_set_element_handler($parser,'start_elem','end_elem');
xml_parser_set_option($parser,XML_OPTION_CASE_FOLDING,0);
xml_parse($parser, $xml);
xml_parser_free($parser);
?>
@@ -0,0 +1,3 @@
http://example.com/foo@a
http://example.com/bar@b foo = bar
http://example.com/bar@c http://example.com/bar@nix = null foo = bar
+26
Ver Arquivo
@@ -0,0 +1,26 @@
<?php
function start_elem($parser,$name,$attribs) {
echo "<$name>";
}
function end_elem()
{
echo "</$name>";
}
$xml = '<text>start<b /> This &amp; that</text>';
$parser = xml_parser_create();
xml_parse_into_struct($parser, $xml, $vals, $index);
print_r($vals);
xml_parser_free($parser);
echo "\nChange to empty end handler\n";
$parser = xml_parser_create();
xml_parser_set_option($parser,XML_OPTION_CASE_FOLDING,0);
xml_set_element_handler($parser,'start_elem','end_elem');
xml_set_element_handler($parser,'start_elem',NULL);
xml_parse($parser, $xml, TRUE);
xml_parser_free($parser);
echo "\nDone\n";
?>
@@ -0,0 +1,37 @@
Array
(
[0] => Array
(
[tag] => TEXT
[type] => open
[level] => 1
[value] => start
)
[1] => Array
(
[tag] => B
[type] => complete
[level] => 2
)
[2] => Array
(
[tag] => TEXT
[value] => This & that
[type] => cdata
[level] => 1
)
[3] => Array
(
[tag] => TEXT
[type] => close
[level] => 1
)
)
Change to empty end handler
<text><b>
Done
@@ -0,0 +1,29 @@
<?php
chdir(dirname(__FILE__));
$start_element = function ($xp, $elem, $attribs)
{
print "<$elem";
if (sizeof($attribs)) {
while (list($k, $v) = each($attribs)) {
print " $k=\"$v\"";
}
}
print ">\n";
};
$end_element = function ($xp, $elem)
{
print "</$elem>\n";
};
$xp = xml_parser_create();
xml_parser_set_option($xp, XML_OPTION_CASE_FOLDING, false);
xml_set_element_handler($xp, $start_element, $end_element);
$fp = fopen("xmltest.xml", "r");
while ($data = fread($fp, 4096)) {
xml_parse($xp, $data, feof($fp));
}
xml_parser_free($xp);
?>
@@ -0,0 +1,10 @@
<root id="elem1">
<elem1>
<elem2>
<elem3>
<elem4>
</elem4>
</elem3>
</elem2>
</elem1>
</root>
@@ -0,0 +1,76 @@
<?php
/* Prototype : proto string xml_error_string(int code)
* Description: Get XML parser error string
* Source code: ext/xml/xml.c
* Alias to functions:
*/
echo "*** Testing xml_error_string() : usage variations ***\n";
error_reporting(E_ALL & ~E_NOTICE);
class aClass {
function __toString() {
return "Some Ascii Data";
}
}
// Initialise function arguments not being substituted (if any)
//get an unset variable
$unset_var = 10;
unset ($unset_var);
//array of values to iterate over
$values = array(
// float data
10.5,
-10.5,
10.1234567e10,
10.7654321E-10,
.5,
// array data
array(),
array(0),
array(1),
array(1, 2),
array('color' => 'red', 'item' => 'pen'),
// null data
NULL,
null,
// boolean data
true,
false,
TRUE,
FALSE,
// empty data
"",
'',
// string data
"string",
'string',
// object data
new aClass(),
// undefined data
$undefined_var,
// unset data
$unset_var,
);
// loop through each element of the array for code
foreach($values as $value) {
echo @"\nArg value $value \n";
var_dump( xml_error_string($value) );
};
echo "Done";
?>
@@ -0,0 +1,81 @@
*** Testing xml_error_string() : usage variations ***
Arg value 10.5
string(22) "XML_ERR_CHARREF_AT_EOF"
Arg value -10.5
string(7) "Unknown"
Arg value 101234567000
string(7) "Unknown"
Arg value 1.07654321E-9
string(8) "No error"
Arg value 0.5
string(8) "No error"
Arg value Array
HipHop Warning: %a
NULL
Arg value Array
HipHop Warning: %a
NULL
Arg value Array
HipHop Warning: %a
NULL
Arg value Array
HipHop Warning: %a
NULL
Arg value Array
HipHop Warning: %a
NULL
Arg value
string(8) "No error"
Arg value
string(8) "No error"
Arg value 1
string(9) "No memory"
Arg value
string(8) "No error"
Arg value 1
string(9) "No memory"
Arg value
string(8) "No error"
Arg value
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value string
HipHop Warning: %a
NULL
Arg value string
HipHop Warning: %a
NULL
Arg value Some Ascii Data
HipHop Warning: %a
NULL
Arg value
string(8) "No error"
Arg value
string(8) "No error"
Done
@@ -0,0 +1,87 @@
<?php
/* Prototype : proto int xml_get_current_byte_index(resource parser)
* Description: Get current byte index for an XML parser
* Source code: ext/xml/xml.c
* Alias to functions:
*/
echo "*** Testing xml_get_current_byte_index() : usage variations ***\n";
error_reporting(E_ALL & ~E_NOTICE);
class aClass {
function __toString() {
return "Some Ascii Data";
}
}
// Initialise function arguments not being substituted (if any)
//get an unset variable
$unset_var = 10;
unset ($unset_var);
$fp = fopen(__FILE__, "r");
//array of values to iterate over
$values = array(
// int data
0,
1,
12345,
-2345,
// float data
10.5,
-10.5,
10.1234567e10,
10.7654321E-10,
.5,
// array data
array(),
array(0),
array(1),
array(1, 2),
array('color' => 'red', 'item' => 'pen'),
// null data
NULL,
null,
// boolean data
true,
false,
TRUE,
FALSE,
// empty data
"",
'',
// string data
"string",
'string',
// object data
new aClass(),
// resource data
$fp,
// undefined data
$undefined_var,
// unset data
$unset_var,
);
// loop through each element of the array for parser
foreach($values as $value) {
echo @"\nArg value $value \n";
var_dump( xml_get_current_byte_index($value) );
};
fclose($fp);
echo "Done";
?>
@@ -0,0 +1,114 @@
*** Testing xml_get_current_byte_index() : usage variations ***
Arg value 0
HipHop Warning: %a
NULL
Arg value 1
HipHop Warning: %a
NULL
Arg value 12345
HipHop Warning: %a
NULL
Arg value -2345
HipHop Warning: %a
NULL
Arg value 10.5
HipHop Warning: %a
NULL
Arg value -10.5
HipHop Warning: %a
NULL
Arg value 101234567000
HipHop Warning: %a
NULL
Arg value 1.07654321E-9
HipHop Warning: %a
NULL
Arg value 0.5
HipHop Warning: %a
NULL
Arg value Array
HipHop Warning: %a
NULL
Arg value Array
HipHop Warning: %a
NULL
Arg value Array
HipHop Warning: %a
NULL
Arg value Array
HipHop Warning: %a
NULL
Arg value Array
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value 1
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value 1
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value string
HipHop Warning: %a
NULL
Arg value string
HipHop Warning: %a
NULL
Arg value Some Ascii Data
HipHop Warning: %a
NULL
Arg value Resource id %s
HipHop Warning: %a
bool(false)
Arg value
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Done
@@ -0,0 +1,88 @@
<?php
/* Prototype : proto int xml_get_current_column_number(resource parser)
* Description: Get current column number for an XML parser
* Source code: ext/xml/xml.c
* Alias to functions:
*/
echo "*** Testing xml_get_current_column_number() : usage variations ***\n";
error_reporting(E_ALL & ~E_NOTICE);
class aClass {
function __toString() {
return "Some Ascii Data";
}
}
// Initialise function arguments not being substituted (if any)
//get an unset variable
$unset_var = 10;
unset ($unset_var);
$fp = fopen(__FILE__, "r");
//array of values to iterate over
$values = array(
// int data
0,
1,
12345,
-2345,
// float data
10.5,
-10.5,
10.1234567e10,
10.7654321E-10,
.5,
// array data
array(),
array(0),
array(1),
array(1, 2),
array('color' => 'red', 'item' => 'pen'),
// null data
NULL,
null,
// boolean data
true,
false,
TRUE,
FALSE,
// empty data
"",
'',
// string data
"string",
'string',
// object data
new aClass(),
// resource data
$fp,
// undefined data
$undefined_var,
// unset data
$unset_var,
);
// loop through each element of the array for parser
foreach($values as $value) {
echo @"\nArg value $value \n";
var_dump( xml_get_current_column_number($value) );
};
fclose($fp);
echo "Done";
?>
@@ -0,0 +1,114 @@
*** Testing xml_get_current_column_number() : usage variations ***
Arg value 0
HipHop Warning: %a
NULL
Arg value 1
HipHop Warning: %a
NULL
Arg value 12345
HipHop Warning: %a
NULL
Arg value -2345
HipHop Warning: %a
NULL
Arg value 10.5
HipHop Warning: %a
NULL
Arg value -10.5
HipHop Warning: %a
NULL
Arg value 101234567000
HipHop Warning: %a
NULL
Arg value 1.07654321E-9
HipHop Warning: %a
NULL
Arg value 0.5
HipHop Warning: %a
NULL
Arg value Array
HipHop Warning: %a
NULL
Arg value Array
HipHop Warning: %a
NULL
Arg value Array
HipHop Warning: %a
NULL
Arg value Array
HipHop Warning: %a
NULL
Arg value Array
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value 1
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value 1
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value string
HipHop Warning: %a
NULL
Arg value string
HipHop Warning: %a
NULL
Arg value Some Ascii Data
HipHop Warning: %a
NULL
Arg value Resource id %s
HipHop Warning: %a
bool(false)
Arg value
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Done
@@ -0,0 +1,87 @@
<?php
/* Prototype : proto int xml_get_current_line_number(resource parser)
* Description: Get current line number for an XML parser
* Source code: ext/xml/xml.c
* Alias to functions:
*/
echo "*** Testing xml_get_current_line_number() : usage variations ***\n";
error_reporting(E_ALL & ~E_NOTICE);
class aClass {
function __toString() {
return "Some Ascii Data";
}
}
// Initialise function arguments not being substituted (if any)
//get an unset variable
$unset_var = 10;
unset ($unset_var);
$fp = fopen(__FILE__, "r");
//array of values to iterate over
$values = array(
// int data
0,
1,
12345,
-2345,
// float data
10.5,
-10.5,
10.1234567e10,
10.7654321E-10,
.5,
// array data
array(),
array(0),
array(1),
array(1, 2),
array('color' => 'red', 'item' => 'pen'),
// null data
NULL,
null,
// boolean data
true,
false,
TRUE,
FALSE,
// empty data
"",
'',
// string data
"string",
'string',
// object data
new aClass(),
// resource data
$fp,
// undefined data
$undefined_var,
// unset data
$unset_var,
);
// loop through each element of the array for parser
foreach($values as $value) {
echo @"\nArg value $value \n";
var_dump( xml_get_current_line_number($value) );
};
fclose($fp);
echo "Done";
?>
@@ -0,0 +1,114 @@
*** Testing xml_get_current_line_number() : usage variations ***
Arg value 0
HipHop Warning: %a
NULL
Arg value 1
HipHop Warning: %a
NULL
Arg value 12345
HipHop Warning: %a
NULL
Arg value -2345
HipHop Warning: %a
NULL
Arg value 10.5
HipHop Warning: %a
NULL
Arg value -10.5
HipHop Warning: %a
NULL
Arg value 101234567000
HipHop Warning: %a
NULL
Arg value 1.07654321E-9
HipHop Warning: %a
NULL
Arg value 0.5
HipHop Warning: %a
NULL
Arg value Array
HipHop Warning: %a
NULL
Arg value Array
HipHop Warning: %a
NULL
Arg value Array
HipHop Warning: %a
NULL
Arg value Array
HipHop Warning: %a
NULL
Arg value Array
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value 1
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value 1
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value string
HipHop Warning: %a
NULL
Arg value string
HipHop Warning: %a
NULL
Arg value Some Ascii Data
HipHop Warning: %a
NULL
Arg value Resource id %s
HipHop Warning: %a
bool(false)
Arg value
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Done
@@ -0,0 +1,87 @@
<?php
/* Prototype : proto int xml_get_error_code(resource parser)
* Description: Get XML parser error code
* Source code: ext/xml/xml.c
* Alias to functions:
*/
echo "*** Testing xml_get_error_code() : usage variations ***\n";
error_reporting(E_ALL & ~E_NOTICE);
class aClass {
function __toString() {
return "Some Ascii Data";
}
}
// Initialise function arguments not being substituted (if any)
//get an unset variable
$unset_var = 10;
unset ($unset_var);
$fp = fopen(__FILE__, "r");
//array of values to iterate over
$values = array(
// int data
0,
1,
12345,
-2345,
// float data
10.5,
-10.5,
10.1234567e10,
10.7654321E-10,
.5,
// array data
array(),
array(0),
array(1),
array(1, 2),
array('color' => 'red', 'item' => 'pen'),
// null data
NULL,
null,
// boolean data
true,
false,
TRUE,
FALSE,
// empty data
"",
'',
// string data
"string",
'string',
// object data
new aClass(),
// resource data
$fp,
// undefined data
$undefined_var,
// unset data
$unset_var,
);
// loop through each element of the array for parser
foreach($values as $value) {
echo @"\nArg value $value \n";
var_dump( xml_get_error_code($value) );
};
fclose($fp);
echo "Done";
?>
@@ -0,0 +1,114 @@
*** Testing xml_get_error_code() : usage variations ***
Arg value 0
HipHop Warning: %a
NULL
Arg value 1
HipHop Warning: %a
NULL
Arg value 12345
HipHop Warning: %a
NULL
Arg value -2345
HipHop Warning: %a
NULL
Arg value 10.5
HipHop Warning: %a
NULL
Arg value -10.5
HipHop Warning: %a
NULL
Arg value 101234567000
HipHop Warning: %a
NULL
Arg value 1.07654321E-9
HipHop Warning: %a
NULL
Arg value 0.5
HipHop Warning: %a
NULL
Arg value Array
HipHop Warning: %a
NULL
Arg value Array
HipHop Warning: %a
NULL
Arg value Array
HipHop Warning: %a
NULL
Arg value Array
HipHop Warning: %a
NULL
Arg value Array
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value 1
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value 1
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value string
HipHop Warning: %a
NULL
Arg value string
HipHop Warning: %a
NULL
Arg value Some Ascii Data
HipHop Warning: %a
NULL
Arg value Resource id %s
HipHop Warning: %a
bool(false)
Arg value
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Done
@@ -0,0 +1,88 @@
<?php
/* Prototype : proto int xml_parse_into_struct(resource parser, string data, array &struct, array &index)
* Description: Parsing a XML document
* Source code: ext/xml/xml.c
* Alias to functions:
*/
echo "*** Testing xml_parse_into_struct() : usage variations ***\n";
error_reporting(E_ALL & ~E_NOTICE);
class aClass {
function __toString() {
return "Some Ascii Data";
}
}
// Initialise function arguments not being substituted (if any)
$data = 'string_val';
//get an unset variable
$unset_var = 10;
unset ($unset_var);
$fp = fopen(__FILE__, "r");
//array of values to iterate over
$values = array(
// int data
0,
1,
12345,
-2345,
// float data
10.5,
-10.5,
10.1234567e10,
10.7654321E-10,
.5,
// array data
array(),
array(0),
array(1),
array(1, 2),
array('color' => 'red', 'item' => 'pen'),
// null data
NULL,
null,
// boolean data
true,
false,
TRUE,
FALSE,
// empty data
"",
'',
// string data
"string",
'string',
// object data
new aClass(),
// resource data
$fp,
// undefined data
$undefined_var,
// unset data
$unset_var,
);
// loop through each element of the array for parser
foreach($values as $value) {
echo @"\nArg value $value \n";
var_dump( xml_parse_into_struct($value, $data, $struct, $index) );
};
fclose($fp);
echo "Done";
?>
@@ -0,0 +1,114 @@
*** Testing xml_parse_into_struct() : usage variations ***
Arg value 0
HipHop Warning: %a
NULL
Arg value 1
HipHop Warning: %a
NULL
Arg value 12345
HipHop Warning: %a
NULL
Arg value -2345
HipHop Warning: %a
NULL
Arg value 10.5
HipHop Warning: %a
NULL
Arg value -10.5
HipHop Warning: %a
NULL
Arg value 101234567000
HipHop Warning: %a
NULL
Arg value 1.07654321E-9
HipHop Warning: %a
NULL
Arg value 0.5
HipHop Warning: %a
NULL
Arg value Array
HipHop Warning: %a
NULL
Arg value Array
HipHop Warning: %a
NULL
Arg value Array
HipHop Warning: %a
NULL
Arg value Array
HipHop Warning: %a
NULL
Arg value Array
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value 1
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value 1
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value string
HipHop Warning: %a
NULL
Arg value string
HipHop Warning: %a
NULL
Arg value Some Ascii Data
HipHop Warning: %a
NULL
Arg value Resource id %s
HipHop Warning: %a
bool(false)
Arg value
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Done
@@ -0,0 +1,89 @@
<?php
/* Prototype : proto int xml_parse(resource parser, string data [, int isFinal])
* Description: Start parsing an XML document
* Source code: ext/xml/xml.c
* Alias to functions:
*/
echo "*** Testing xml_parse() : usage variations ***\n";
error_reporting(E_ALL & ~E_NOTICE);
class aClass {
function __toString() {
return "Some Ascii Data";
}
}
// Initialise function arguments not being substituted (if any)
$data = 'string_val';
$isFinal = 10;
//get an unset variable
$unset_var = 10;
unset ($unset_var);
$fp = fopen(__FILE__, "r");
//array of values to iterate over
$values = array(
// int data
0,
1,
12345,
-2345,
// float data
10.5,
-10.5,
10.1234567e10,
10.7654321E-10,
.5,
// array data
array(),
array(0),
array(1),
array(1, 2),
array('color' => 'red', 'item' => 'pen'),
// null data
NULL,
null,
// boolean data
true,
false,
TRUE,
FALSE,
// empty data
"",
'',
// string data
"string",
'string',
// object data
new aClass(),
// resource data
$fp,
// undefined data
$undefined_var,
// unset data
$unset_var,
);
// loop through each element of the array for parser
foreach($values as $value) {
echo @"\nArg value $value \n";
var_dump( xml_parse($value, $data, $isFinal) );
};
fclose($fp);
echo "Done";
?>
@@ -0,0 +1,114 @@
*** Testing xml_parse() : usage variations ***
Arg value 0
HipHop Warning: %a
NULL
Arg value 1
HipHop Warning: %a
NULL
Arg value 12345
HipHop Warning: %a
NULL
Arg value -2345
HipHop Warning: %a
NULL
Arg value 10.5
HipHop Warning: %a
NULL
Arg value -10.5
HipHop Warning: %a
NULL
Arg value 101234567000
HipHop Warning: %a
NULL
Arg value 1.07654321E-9
HipHop Warning: %a
NULL
Arg value 0.5
HipHop Warning: %a
NULL
Arg value Array
HipHop Warning: %a
NULL
Arg value Array
HipHop Warning: %a
NULL
Arg value Array
HipHop Warning: %a
NULL
Arg value Array
HipHop Warning: %a
NULL
Arg value Array
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value 1
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value 1
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value string
HipHop Warning: %a
NULL
Arg value string
HipHop Warning: %a
NULL
Arg value Some Ascii Data
HipHop Warning: %a
NULL
Arg value Resource id %s
HipHop Warning: %a
bool(false)
Arg value
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Done
@@ -0,0 +1,18 @@
<?php
/* Prototype : proto resource xml_parser_create([string encoding])
* Description: Create an XML parser
* Source code: ext/xml/xml.c
* Alias to functions:
*/
echo "*** Testing xml_parser_create() : error conditions ***\n";
//Test xml_parser_create with one more than the expected number of arguments
echo "\n-- Testing xml_parser_create() function with more than expected no. of arguments --\n";
$encoding = 'utf-8';
$extra_arg = 10;
var_dump( xml_parser_create($encoding, $extra_arg) );
echo "Done";
?>
@@ -0,0 +1,6 @@
*** Testing xml_parser_create() : error conditions ***
-- Testing xml_parser_create() function with more than expected no. of arguments --
HipHop Warning: %a
bool(false)
Done
@@ -0,0 +1,19 @@
<?php
/* Prototype : proto resource xml_parser_create_ns([string encoding [, string sep]])
* Description: Create an XML parser
* Source code: ext/xml/xml.c
* Alias to functions:
*/
echo "*** Testing xml_parser_create_ns() : error conditions ***\n";
//Test xml_parser_create_ns with one more than the expected number of arguments
echo "\n-- Testing xml_parser_create_ns() function with more than expected no. of arguments --\n";
$encoding = 'string_val';
$sep = 'string_val';
$extra_arg = 10;
var_dump( xml_parser_create_ns($encoding, $sep, $extra_arg) );
echo "Done";
?>
@@ -0,0 +1,6 @@
*** Testing xml_parser_create_ns() : error conditions ***
-- Testing xml_parser_create_ns() function with more than expected no. of arguments --
HipHop Warning: %a
bool(false)
Done
@@ -0,0 +1,95 @@
<?php
/* Prototype : proto resource xml_parser_create_ns([string encoding [, string sep]])
* Description: Create an XML parser
* Source code: ext/xml/xml.c
* Alias to functions:
*/
echo "*** Testing xml_parser_create_ns() : usage variations ***\n";
error_reporting(E_ALL & ~E_NOTICE);
class aClass {
function __toString() {
return "Some Ascii Data";
}
}
// Initialise function arguments not being substituted (if any)
//get an unset variable
$unset_var = 10;
unset ($unset_var);
$fp = fopen(__FILE__, "r");
//array of values to iterate over
$values = array(
// int data
0,
1,
12345,
-2345,
// float data
10.5,
-10.5,
10.1234567e10,
10.7654321E-10,
.5,
// array data
array(),
array(0),
array(1),
array(1, 2),
array('color' => 'red', 'item' => 'pen'),
// null data
NULL,
null,
// boolean data
true,
false,
TRUE,
FALSE,
// empty data
"",
'',
// string data
"string",
'string',
"ISO-8859-1",
"UTF-8",
"US-ASCII",
"UTF-32",
// object data
new aClass(),
// resource data
$fp,
// undefined data
$undefined_var,
// unset data
$unset_var,
);
// loop through each element of the array for encoding
foreach($values as $value) {
echo @"\nArg value $value \n";
$res = xml_parser_create_ns($value);
var_dump($res);
if ($res !== false) {
xml_parser_free($res);
}
};
fclose($fp);
echo "Done";
?>
@@ -0,0 +1,119 @@
*** Testing xml_parser_create_ns() : usage variations ***
Arg value 0
HipHop Warning: %a
bool(false)
Arg value 1
HipHop Warning: %a
bool(false)
Arg value 12345
HipHop Warning: %a
bool(false)
Arg value -2345
HipHop Warning: %a
bool(false)
Arg value 10.5
HipHop Warning: %a
bool(false)
Arg value -10.5
HipHop Warning: %a
bool(false)
Arg value 101234567000
HipHop Warning: %a
bool(false)
Arg value 1.07654321E-9
HipHop Warning: %a
bool(false)
Arg value 0.5
HipHop Warning: %a
bool(false)
Arg value Array
HipHop Warning: %a
bool(false)
Arg value Array
HipHop Warning: %a
bool(false)
Arg value Array
HipHop Warning: %a
bool(false)
Arg value Array
HipHop Warning: %a
bool(false)
Arg value Array
HipHop Warning: %a
bool(false)
Arg value
resource(%d) of type (xml)
Arg value
resource(%d) of type (xml)
Arg value 1
HipHop Warning: %a
bool(false)
Arg value
resource(%d) of type (xml)
Arg value 1
HipHop Warning: %a
bool(false)
Arg value
resource(%d) of type (xml)
Arg value
resource(%d) of type (xml)
Arg value
resource(%d) of type (xml)
Arg value string
HipHop Warning: %a
bool(false)
Arg value string
HipHop Warning: %a
bool(false)
Arg value ISO-8859-1
resource(%d) of type (xml)
Arg value UTF-8
resource(%d) of type (xml)
Arg value US-ASCII
resource(%d) of type (xml)
Arg value UTF-32
HipHop Warning: %a
bool(false)
Arg value Some Ascii Data
HipHop Warning: %a
bool(false)
Arg value Resource id %s
HipHop Warning: %a
bool(false)
Arg value
resource(%d) of type (xml)
Arg value
resource(%d) of type (xml)
Done
@@ -0,0 +1,95 @@
<?php
/* Prototype : proto resource xml_parser_create([string encoding])
* Description: Create an XML parser
* Source code: ext/xml/xml.c
* Alias to functions:
*/
echo "*** Testing xml_parser_create() : usage variations ***\n";
error_reporting(E_ALL & ~E_NOTICE);
class aClass {
function __toString() {
return "Some Ascii Data";
}
}
// Initialise function arguments not being substituted (if any)
//get an unset variable
$unset_var = 10;
unset ($unset_var);
$fp = fopen(__FILE__, "r");
//array of values to iterate over
$values = array(
// int data
0,
1,
12345,
-2345,
// float data
10.5,
-10.5,
10.1234567e10,
10.7654321E-10,
.5,
// array data
array(),
array(0),
array(1),
array(1, 2),
array('color' => 'red', 'item' => 'pen'),
// null data
NULL,
null,
// boolean data
true,
false,
TRUE,
FALSE,
// empty data
"",
'',
// string data
"string",
'string',
"ISO-8859-1",
"UTF-8",
"US-ASCII",
"UTF-32",
// object data
new aClass(),
// resource data
$fp,
// undefined data
$undefined_var,
// unset data
$unset_var,
);
// loop through each element of the array for encoding
foreach($values as $value) {
echo @"\nArg value $value \n";
$res = xml_parser_create($value);
var_dump($res);
if ($res !== false) {
xml_parser_free($res);
}
};
fclose($fp);
echo "Done";
?>
@@ -0,0 +1,119 @@
*** Testing xml_parser_create() : usage variations ***
Arg value 0
HipHop Warning: %a
bool(false)
Arg value 1
HipHop Warning: %a
bool(false)
Arg value 12345
HipHop Warning: %a
bool(false)
Arg value -2345
HipHop Warning: %a
bool(false)
Arg value 10.5
HipHop Warning: %a
bool(false)
Arg value -10.5
HipHop Warning: %a
bool(false)
Arg value 101234567000
HipHop Warning: %a
bool(false)
Arg value 1.07654321E-9
HipHop Warning: %a
bool(false)
Arg value 0.5
HipHop Warning: %a
bool(false)
Arg value Array
HipHop Warning: %a
bool(false)
Arg value Array
HipHop Warning: %a
bool(false)
Arg value Array
HipHop Warning: %a
bool(false)
Arg value Array
HipHop Warning: %a
bool(false)
Arg value Array
HipHop Warning: %a
bool(false)
Arg value
resource(%d) of type (xml)
Arg value
resource(%d) of type (xml)
Arg value 1
HipHop Warning: %a
bool(false)
Arg value
resource(%d) of type (xml)
Arg value 1
HipHop Warning: %a
bool(false)
Arg value
resource(%d) of type (xml)
Arg value
resource(%d) of type (xml)
Arg value
resource(%d) of type (xml)
Arg value string
HipHop Warning: %a
bool(false)
Arg value string
HipHop Warning: %a
bool(false)
Arg value ISO-8859-1
resource(%d) of type (xml)
Arg value UTF-8
resource(%d) of type (xml)
Arg value US-ASCII
resource(%d) of type (xml)
Arg value UTF-32
HipHop Warning: %a
bool(false)
Arg value Some Ascii Data
HipHop Warning: %a
bool(false)
Arg value Resource id %s
HipHop Warning: %a
bool(false)
Arg value
resource(%d) of type (xml)
Arg value
resource(%d) of type (xml)
Done
@@ -0,0 +1,87 @@
<?php
/* Prototype : proto int xml_parser_free(resource parser)
* Description: Free an XML parser
* Source code: ext/xml/xml.c
* Alias to functions:
*/
echo "*** Testing xml_parser_free() : usage variations ***\n";
error_reporting(E_ALL & ~E_NOTICE);
class aClass {
function __toString() {
return "Some Ascii Data";
}
}
// Initialise function arguments not being substituted (if any)
//get an unset variable
$unset_var = 10;
unset ($unset_var);
$fp = fopen(__FILE__, "r");
//array of values to iterate over
$values = array(
// int data
0,
1,
12345,
-2345,
// float data
10.5,
-10.5,
10.1234567e10,
10.7654321E-10,
.5,
// array data
array(),
array(0),
array(1),
array(1, 2),
array('color' => 'red', 'item' => 'pen'),
// null data
NULL,
null,
// boolean data
true,
false,
TRUE,
FALSE,
// empty data
"",
'',
// string data
"string",
'string',
// object data
new aClass(),
// resource data
$fp,
// undefined data
$undefined_var,
// unset data
$unset_var,
);
// loop through each element of the array for parser
foreach($values as $value) {
echo @"\nArg value $value \n";
var_dump( xml_parser_free($value) );
};
fclose($fp);
echo "Done";
?>
@@ -0,0 +1,114 @@
*** Testing xml_parser_free() : usage variations ***
Arg value 0
HipHop Warning: %a
NULL
Arg value 1
HipHop Warning: %a
NULL
Arg value 12345
HipHop Warning: %a
NULL
Arg value -2345
HipHop Warning: %a
NULL
Arg value 10.5
HipHop Warning: %a
NULL
Arg value -10.5
HipHop Warning: %a
NULL
Arg value 101234567000
HipHop Warning: %a
NULL
Arg value 1.07654321E-9
HipHop Warning: %a
NULL
Arg value 0.5
HipHop Warning: %a
NULL
Arg value Array
HipHop Warning: %a
NULL
Arg value Array
HipHop Warning: %a
NULL
Arg value Array
HipHop Warning: %a
NULL
Arg value Array
HipHop Warning: %a
NULL
Arg value Array
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value 1
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value 1
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value string
HipHop Warning: %a
NULL
Arg value string
HipHop Warning: %a
NULL
Arg value Some Ascii Data
HipHop Warning: %a
NULL
Arg value Resource id %s
HipHop Warning: %a
bool(false)
Arg value
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Done
@@ -0,0 +1,88 @@
<?php
/* Prototype : proto int xml_parser_get_option(resource parser, int option)
* Description: Get options from an XML parser
* Source code: ext/xml/xml.c
* Alias to functions:
*/
echo "*** Testing xml_parser_get_option() : usage variations ***\n";
error_reporting(E_ALL & ~E_NOTICE);
class aClass {
function __toString() {
return "Some Ascii Data";
}
}
// Initialise function arguments not being substituted (if any)
$option = 10;
//get an unset variable
$unset_var = 10;
unset ($unset_var);
$fp = fopen(__FILE__, "r");
//array of values to iterate over
$values = array(
// int data
0,
1,
12345,
-2345,
// float data
10.5,
-10.5,
10.1234567e10,
10.7654321E-10,
.5,
// array data
array(),
array(0),
array(1),
array(1, 2),
array('color' => 'red', 'item' => 'pen'),
// null data
NULL,
null,
// boolean data
true,
false,
TRUE,
FALSE,
// empty data
"",
'',
// string data
"string",
'string',
// object data
new aClass(),
// resource data
$fp,
// undefined data
$undefined_var,
// unset data
$unset_var,
);
// loop through each element of the array for parser
foreach($values as $value) {
echo @"\nArg value $value \n";
var_dump( xml_parser_get_option($value, $option) );
};
fclose($fp);
echo "Done";
?>
@@ -0,0 +1,114 @@
*** Testing xml_parser_get_option() : usage variations ***
Arg value 0
HipHop Warning: %a
NULL
Arg value 1
HipHop Warning: %a
NULL
Arg value 12345
HipHop Warning: %a
NULL
Arg value -2345
HipHop Warning: %a
NULL
Arg value 10.5
HipHop Warning: %a
NULL
Arg value -10.5
HipHop Warning: %a
NULL
Arg value 101234567000
HipHop Warning: %a
NULL
Arg value 1.07654321E-9
HipHop Warning: %a
NULL
Arg value 0.5
HipHop Warning: %a
NULL
Arg value Array
HipHop Warning: %a
NULL
Arg value Array
HipHop Warning: %a
NULL
Arg value Array
HipHop Warning: %a
NULL
Arg value Array
HipHop Warning: %a
NULL
Arg value Array
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value 1
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value 1
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value string
HipHop Warning: %a
NULL
Arg value string
HipHop Warning: %a
NULL
Arg value Some Ascii Data
HipHop Warning: %a
NULL
Arg value Resource id %s
HipHop Warning: %a
bool(false)
Arg value
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Done
@@ -0,0 +1,87 @@
<?php
/* Prototype : proto int xml_parser_get_option(resource parser, int option)
* Description: Get options from an XML parser
* Source code: ext/xml/xml.c
* Alias to functions:
*/
echo "*** Testing xml_parser_get_option() : usage variations ***\n";
error_reporting(E_ALL & ~E_NOTICE);
class aClass {
function __toString() {
return "Some Ascii Data";
}
}
// Initialise function arguments not being substituted (if any)
$parser = xml_parser_create();
//get an unset variable
$unset_var = 10;
unset ($unset_var);
$fp = fopen(__FILE__, "r");
//array of values to iterate over
$values = array(
// outside of range int data
12345,
-2345,
// float data
10.5,
-10.5,
10.1234567e10,
10.7654321E-10,
.5,
// array data
array(),
array(0),
array(1),
array(1, 2),
array('color' => 'red', 'item' => 'pen'),
// null data
NULL,
null,
// boolean data
true,
false,
TRUE,
FALSE,
// empty data
"",
'',
// string data
"string",
'string',
// object data
new aClass(),
// resource data
$fp,
// undefined data
$undefined_var,
// unset data
$unset_var,
);
// loop through each element of the array for option
foreach($values as $value) {
echo @"\nArg value $value \n";
var_dump( xml_parser_get_option($parser, $value) );
};
fclose($fp);
xml_parser_free($parser);
echo "Done";
?>
@@ -0,0 +1,104 @@
*** Testing xml_parser_get_option() : usage variations ***
Arg value 12345
HipHop Warning: %a
bool(false)
Arg value -2345
HipHop Warning: %a
bool(false)
Arg value 10.5
HipHop Warning: %a
bool(false)
Arg value -10.5
HipHop Warning: %a
bool(false)
Arg value 101234567000
HipHop Warning: %a
bool(false)
Arg value 1.07654321E-9
HipHop Warning: %a
bool(false)
Arg value 0.5
HipHop Warning: %a
bool(false)
Arg value Array
HipHop Warning: %a
NULL
Arg value Array
HipHop Warning: %a
NULL
Arg value Array
HipHop Warning: %a
NULL
Arg value Array
HipHop Warning: %a
NULL
Arg value Array
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
bool(false)
Arg value
HipHop Warning: %a
bool(false)
Arg value 1
int(1)
Arg value
HipHop Warning: %a
bool(false)
Arg value 1
int(1)
Arg value
HipHop Warning: %a
bool(false)
Arg value
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value string
HipHop Warning: %a
NULL
Arg value string
HipHop Warning: %a
NULL
Arg value Some Ascii Data
HipHop Warning: %a
NULL
Arg value Resource id %s
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
bool(false)
Arg value
HipHop Warning: %a
bool(false)
Done
@@ -0,0 +1,88 @@
<?php
/* Prototype : proto int xml_parser_set_option(resource parser, int option, mixed value)
* Description: Set options in an XML parser
* Source code: ext/xml/xml.c
* Alias to functions:
*/
echo "*** Testing xml_parser_set_option() : usage variations ***\n";
error_reporting(E_ALL & ~E_NOTICE);
class aClass {
function __toString() {
return "Some Ascii Data";
}
}
// Initialise function arguments not being substituted (if any)
$option = 10;
//get an unset variable
$unset_var = 10;
unset ($unset_var);
$fp = fopen(__FILE__, "r");
//array of values to iterate over
$values = array(
// int data
0,
1,
12345,
-2345,
// float data
10.5,
-10.5,
10.1234567e10,
10.7654321E-10,
.5,
// array data
array(),
array(0),
array(1),
array(1, 2),
array('color' => 'red', 'item' => 'pen'),
// null data
NULL,
null,
// boolean data
true,
false,
TRUE,
FALSE,
// empty data
"",
'',
// string data
"string",
'string',
// object data
new aClass(),
// resource data
$fp,
// undefined data
$undefined_var,
// unset data
$unset_var,
);
// loop through each element of the array for parser
foreach($values as $value) {
echo @"\nArg value $value \n";
var_dump( xml_parser_set_option($value, $option, 1) );
};
fclose($fp);
echo "Done";
?>
@@ -0,0 +1,114 @@
*** Testing xml_parser_set_option() : usage variations ***
Arg value 0
HipHop Warning: %a
NULL
Arg value 1
HipHop Warning: %a
NULL
Arg value 12345
HipHop Warning: %a
NULL
Arg value -2345
HipHop Warning: %a
NULL
Arg value 10.5
HipHop Warning: %a
NULL
Arg value -10.5
HipHop Warning: %a
NULL
Arg value 101234567000
HipHop Warning: %a
NULL
Arg value 1.07654321E-9
HipHop Warning: %a
NULL
Arg value 0.5
HipHop Warning: %a
NULL
Arg value Array
HipHop Warning: %a
NULL
Arg value Array
HipHop Warning: %a
NULL
Arg value Array
HipHop Warning: %a
NULL
Arg value Array
HipHop Warning: %a
NULL
Arg value Array
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value 1
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value 1
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value string
HipHop Warning: %a
NULL
Arg value string
HipHop Warning: %a
NULL
Arg value Some Ascii Data
HipHop Warning: %a
NULL
Arg value Resource id %s
HipHop Warning: %a
bool(false)
Arg value
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Done
@@ -0,0 +1,81 @@
<?php
/* Prototype : proto int xml_parser_set_option(resource parser, int option, mixed value)
* Description: Set options in an XML parser
* Source code: ext/xml/xml.c
* Alias to functions:
*/
echo "*** Testing xml_parser_set_option() : usage variations ***\n";
error_reporting(E_ALL & ~E_NOTICE);
class aClass {
function __toString() {
return "Some Ascii Data";
}
}
// Initialise function arguments not being substituted (if any)
$parser = xml_parser_create();
//get an unset variable
$unset_var = 10;
unset ($unset_var);
//array of values to iterate over
$values = array(
// outside of range int data
12345,
-2345,
// float data
10.5,
-10.5,
10.1234567e10,
10.7654321E-10,
.5,
// array data
array(),
array(0),
array(1),
array(1, 2),
array('color' => 'red', 'item' => 'pen'),
// null data
NULL,
null,
// boolean data
true,
false,
TRUE,
FALSE,
// empty data
"",
'',
// string data
"string",
'string',
// object data
new aClass(),
// undefined data
$undefined_var,
// unset data
$unset_var,
);
// loop through each element of the array for option
foreach($values as $value) {
echo @"\nArg value $value \n";
var_dump( xml_parser_set_option($parser, $value, 1) );
};
xml_parser_free($parser);
echo "Done";
?>
@@ -0,0 +1,100 @@
*** Testing xml_parser_set_option() : usage variations ***
Arg value 12345
HipHop Warning: %a
bool(false)
Arg value -2345
HipHop Warning: %a
bool(false)
Arg value 10.5
HipHop Warning: %a
bool(false)
Arg value -10.5
HipHop Warning: %a
bool(false)
Arg value 101234567000
HipHop Warning: %a
bool(false)
Arg value 1.07654321E-9
HipHop Warning: %a
bool(false)
Arg value 0.5
HipHop Warning: %a
bool(false)
Arg value Array
HipHop Warning: %a
NULL
Arg value Array
HipHop Warning: %a
NULL
Arg value Array
HipHop Warning: %a
NULL
Arg value Array
HipHop Warning: %a
NULL
Arg value Array
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
bool(false)
Arg value
HipHop Warning: %a
bool(false)
Arg value 1
bool(true)
Arg value
HipHop Warning: %a
bool(false)
Arg value 1
bool(true)
Arg value
HipHop Warning: %a
bool(false)
Arg value
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value string
HipHop Warning: %a
NULL
Arg value string
HipHop Warning: %a
NULL
Arg value Some Ascii Data
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
bool(false)
Arg value
HipHop Warning: %a
bool(false)
Done
@@ -0,0 +1,92 @@
<?php
/* Prototype : proto int xml_set_character_data_handler(resource parser, string hdl)
* Description: Set up character data handler
* Source code: ext/xml/xml.c
* Alias to functions:
*/
echo "*** Testing xml_set_character_data_handler() : usage variations ***\n";
error_reporting(E_ALL & ~E_NOTICE);
class aClass {
function __toString() {
return "Some Ascii Data";
}
}
function validHandler(resource $parser ,string $data) {
}
// Initialise function arguments not being substituted (if any)
$hdl = 'validHandler';
//get an unset variable
$unset_var = 10;
unset ($unset_var);
$fp = fopen(__FILE__, "r");
//array of values to iterate over
$values = array(
// int data
0,
1,
12345,
-2345,
// float data
10.5,
-10.5,
10.1234567e10,
10.7654321E-10,
.5,
// array data
array(),
array(0),
array(1),
array(1, 2),
array('color' => 'red', 'item' => 'pen'),
// null data
NULL,
null,
// boolean data
true,
false,
TRUE,
FALSE,
// empty data
"",
'',
// string data
"string",
'string',
// object data
new aClass(),
// resource data
$fp,
// undefined data
$undefined_var,
// unset data
$unset_var,
);
// loop through each element of the array for parser
foreach($values as $value) {
echo @"\nArg value $value \n";
var_dump( xml_set_character_data_handler($value, $hdl) );
};
fclose($fp);
echo "Done";
?>
@@ -0,0 +1,114 @@
*** Testing xml_set_character_data_handler() : usage variations ***
Arg value 0
HipHop Warning: %a
NULL
Arg value 1
HipHop Warning: %a
NULL
Arg value 12345
HipHop Warning: %a
NULL
Arg value -2345
HipHop Warning: %a
NULL
Arg value 10.5
HipHop Warning: %a
NULL
Arg value -10.5
HipHop Warning: %a
NULL
Arg value 101234567000
HipHop Warning: %a
NULL
Arg value 1.07654321E-9
HipHop Warning: %a
NULL
Arg value 0.5
HipHop Warning: %a
NULL
Arg value Array
HipHop Warning: %a
NULL
Arg value Array
HipHop Warning: %a
NULL
Arg value Array
HipHop Warning: %a
NULL
Arg value Array
HipHop Warning: %a
NULL
Arg value Array
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value 1
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value 1
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value string
HipHop Warning: %a
NULL
Arg value string
HipHop Warning: %a
NULL
Arg value Some Ascii Data
HipHop Warning: %a
NULL
Arg value Resource id %s
HipHop Warning: %a
bool(false)
Arg value
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Done
@@ -0,0 +1,92 @@
<?php
/* Prototype : proto int xml_set_default_handler(resource parser, string hdl)
* Description: Set up default handler
* Source code: ext/xml/xml.c
* Alias to functions:
*/
echo "*** Testing xml_set_default_handler() : usage variations ***\n";
error_reporting(E_ALL & ~E_NOTICE);
class aClass {
function __toString() {
return "Some Ascii Data";
}
}
function validHandler(resource $parser ,string $data) {
}
// Initialise function arguments not being substituted (if any)
$hdl = 'validHandler';
//get an unset variable
$unset_var = 10;
unset ($unset_var);
$fp = fopen(__FILE__, "r");
//array of values to iterate over
$values = array(
// int data
0,
1,
12345,
-2345,
// float data
10.5,
-10.5,
10.1234567e10,
10.7654321E-10,
.5,
// array data
array(),
array(0),
array(1),
array(1, 2),
array('color' => 'red', 'item' => 'pen'),
// null data
NULL,
null,
// boolean data
true,
false,
TRUE,
FALSE,
// empty data
"",
'',
// string data
"string",
'string',
// object data
new aClass(),
// resource data
$fp,
// undefined data
$undefined_var,
// unset data
$unset_var,
);
// loop through each element of the array for parser
foreach($values as $value) {
echo @"\nArg value $value \n";
var_dump( xml_set_default_handler($value, $hdl) );
};
fclose($fp);
echo "Done";
?>
@@ -0,0 +1,114 @@
*** Testing xml_set_default_handler() : usage variations ***
Arg value 0
HipHop Warning: %a
NULL
Arg value 1
HipHop Warning: %a
NULL
Arg value 12345
HipHop Warning: %a
NULL
Arg value -2345
HipHop Warning: %a
NULL
Arg value 10.5
HipHop Warning: %a
NULL
Arg value -10.5
HipHop Warning: %a
NULL
Arg value 101234567000
HipHop Warning: %a
NULL
Arg value 1.07654321E-9
HipHop Warning: %a
NULL
Arg value 0.5
HipHop Warning: %a
NULL
Arg value Array
HipHop Warning: %a
NULL
Arg value Array
HipHop Warning: %a
NULL
Arg value Array
HipHop Warning: %a
NULL
Arg value Array
HipHop Warning: %a
NULL
Arg value Array
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value 1
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value 1
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value string
HipHop Warning: %a
NULL
Arg value string
HipHop Warning: %a
NULL
Arg value Some Ascii Data
HipHop Warning: %a
NULL
Arg value Resource id %s
HipHop Warning: %a
bool(false)
Arg value
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Done
@@ -0,0 +1,92 @@
<?php
/* Prototype : proto int xml_set_element_handler(resource parser, string shdl, string ehdl)
* Description: Set up start and end element handlers
* Source code: ext/xml/xml.c
* Alias to functions:
*/
echo "*** Testing xml_set_element_handler() : usage variations ***\n";
error_reporting(E_ALL & ~E_NOTICE);
class aClass {
function __toString() {
return "Some Ascii Data";
}
}
function validHandler(resource $parser ,string $data) {
}
// Initialise function arguments not being substituted (if any)
$hdl = 'validHandler';
//get an unset variable
$unset_var = 10;
unset ($unset_var);
$fp = fopen(__FILE__, "r");
//array of values to iterate over
$values = array(
// int data
0,
1,
12345,
-2345,
// float data
10.5,
-10.5,
10.1234567e10,
10.7654321E-10,
.5,
// array data
array(),
array(0),
array(1),
array(1, 2),
array('color' => 'red', 'item' => 'pen'),
// null data
NULL,
null,
// boolean data
true,
false,
TRUE,
FALSE,
// empty data
"",
'',
// string data
"string",
'string',
// object data
new aClass(),
// resource data
$fp,
// undefined data
$undefined_var,
// unset data
$unset_var,
);
// loop through each element of the array for parser
foreach($values as $value) {
echo @"\nArg value $value \n";
var_dump( xml_set_element_handler($value, $hdl, $hdl) );
};
fclose($fp);
echo "Done";
?>
@@ -0,0 +1,114 @@
*** Testing xml_set_element_handler() : usage variations ***
Arg value 0
HipHop Warning: %a
NULL
Arg value 1
HipHop Warning: %a
NULL
Arg value 12345
HipHop Warning: %a
NULL
Arg value -2345
HipHop Warning: %a
NULL
Arg value 10.5
HipHop Warning: %a
NULL
Arg value -10.5
HipHop Warning: %a
NULL
Arg value 101234567000
HipHop Warning: %a
NULL
Arg value 1.07654321E-9
HipHop Warning: %a
NULL
Arg value 0.5
HipHop Warning: %a
NULL
Arg value Array
HipHop Warning: %a
NULL
Arg value Array
HipHop Warning: %a
NULL
Arg value Array
HipHop Warning: %a
NULL
Arg value Array
HipHop Warning: %a
NULL
Arg value Array
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value 1
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value 1
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value string
HipHop Warning: %a
NULL
Arg value string
HipHop Warning: %a
NULL
Arg value Some Ascii Data
HipHop Warning: %a
NULL
Arg value Resource id %s
HipHop Warning: %a
bool(false)
Arg value
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Done
@@ -0,0 +1,92 @@
<?php
/* Prototype : proto int xml_set_end_namespace_decl_handler(resource parser, string hdl)
* Description: Set up character data handler
* Source code: ext/xml/xml.c
* Alias to functions:
*/
echo "*** Testing xml_set_end_namespace_decl_handler() : usage variations ***\n";
error_reporting(E_ALL & ~E_NOTICE);
class aClass {
function __toString() {
return "Some Ascii Data";
}
}
function validHandler(resource $parser ,string $data) {
}
// Initialise function arguments not being substituted (if any)
$hdl = 'validHandler';
//get an unset variable
$unset_var = 10;
unset ($unset_var);
$fp = fopen(__FILE__, "r");
//array of values to iterate over
$values = array(
// int data
0,
1,
12345,
-2345,
// float data
10.5,
-10.5,
10.1234567e10,
10.7654321E-10,
.5,
// array data
array(),
array(0),
array(1),
array(1, 2),
array('color' => 'red', 'item' => 'pen'),
// null data
NULL,
null,
// boolean data
true,
false,
TRUE,
FALSE,
// empty data
"",
'',
// string data
"string",
'string',
// object data
new aClass(),
// resource data
$fp,
// undefined data
$undefined_var,
// unset data
$unset_var,
);
// loop through each element of the array for parser
foreach($values as $value) {
echo @"\nArg value $value \n";
var_dump( xml_set_end_namespace_decl_handler($value, $hdl) );
};
fclose($fp);
echo "Done";
?>
@@ -0,0 +1,114 @@
*** Testing xml_set_end_namespace_decl_handler() : usage variations ***
Arg value 0
HipHop Warning: %a
NULL
Arg value 1
HipHop Warning: %a
NULL
Arg value 12345
HipHop Warning: %a
NULL
Arg value -2345
HipHop Warning: %a
NULL
Arg value 10.5
HipHop Warning: %a
NULL
Arg value -10.5
HipHop Warning: %a
NULL
Arg value 101234567000
HipHop Warning: %a
NULL
Arg value 1.07654321E-9
HipHop Warning: %a
NULL
Arg value 0.5
HipHop Warning: %a
NULL
Arg value Array
HipHop Warning: %a
NULL
Arg value Array
HipHop Warning: %a
NULL
Arg value Array
HipHop Warning: %a
NULL
Arg value Array
HipHop Warning: %a
NULL
Arg value Array
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value 1
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value 1
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value string
HipHop Warning: %a
NULL
Arg value string
HipHop Warning: %a
NULL
Arg value Some Ascii Data
HipHop Warning: %a
NULL
Arg value Resource id %s
HipHop Warning: %a
bool(false)
Arg value
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Done
@@ -0,0 +1,92 @@
<?php
/* Prototype : proto int xml_set_external_entity_ref_handler(resource parser, string hdl)
* Description: Set up external entity reference handler
* Source code: ext/xml/xml.c
* Alias to functions:
*/
echo "*** Testing xml_set_external_entity_ref_handler() : usage variations ***\n";
error_reporting(E_ALL & ~E_NOTICE);
class aClass {
function __toString() {
return "Some Ascii Data";
}
}
function validHandler(resource $parser ,string $data) {
}
// Initialise function arguments not being substituted (if any)
$hdl = 'validHandler';
//get an unset variable
$unset_var = 10;
unset ($unset_var);
$fp = fopen(__FILE__, "r");
//array of values to iterate over
$values = array(
// int data
0,
1,
12345,
-2345,
// float data
10.5,
-10.5,
10.1234567e10,
10.7654321E-10,
.5,
// array data
array(),
array(0),
array(1),
array(1, 2),
array('color' => 'red', 'item' => 'pen'),
// null data
NULL,
null,
// boolean data
true,
false,
TRUE,
FALSE,
// empty data
"",
'',
// string data
"string",
'string',
// object data
new aClass(),
// resource data
$fp,
// undefined data
$undefined_var,
// unset data
$unset_var,
);
// loop through each element of the array for parser
foreach($values as $value) {
echo @"\nArg value $value \n";
var_dump( xml_set_external_entity_ref_handler($value, $hdl) );
};
fclose($fp);
echo "Done";
?>
@@ -0,0 +1,114 @@
*** Testing xml_set_external_entity_ref_handler() : usage variations ***
Arg value 0
HipHop Warning: %a
NULL
Arg value 1
HipHop Warning: %a
NULL
Arg value 12345
HipHop Warning: %a
NULL
Arg value -2345
HipHop Warning: %a
NULL
Arg value 10.5
HipHop Warning: %a
NULL
Arg value -10.5
HipHop Warning: %a
NULL
Arg value 101234567000
HipHop Warning: %a
NULL
Arg value 1.07654321E-9
HipHop Warning: %a
NULL
Arg value 0.5
HipHop Warning: %a
NULL
Arg value Array
HipHop Warning: %a
NULL
Arg value Array
HipHop Warning: %a
NULL
Arg value Array
HipHop Warning: %a
NULL
Arg value Array
HipHop Warning: %a
NULL
Arg value Array
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value 1
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value 1
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value string
HipHop Warning: %a
NULL
Arg value string
HipHop Warning: %a
NULL
Arg value Some Ascii Data
HipHop Warning: %a
NULL
Arg value Resource id %s
HipHop Warning: %a
bool(false)
Arg value
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Done
@@ -0,0 +1,92 @@
<?php
/* Prototype : proto int xml_set_notation_decl_handler(resource parser, string hdl)
* Description: Set up notation declaration handler
* Source code: ext/xml/xml.c
* Alias to functions:
*/
echo "*** Testing xml_set_notation_decl_handler() : usage variations ***\n";
error_reporting(E_ALL & ~E_NOTICE);
class aClass {
function __toString() {
return "Some Ascii Data";
}
}
function validHandler(resource $parser ,string $data) {
}
// Initialise function arguments not being substituted (if any)
$hdl = 'validHandler';
//get an unset variable
$unset_var = 10;
unset ($unset_var);
$fp = fopen(__FILE__, "r");
//array of values to iterate over
$values = array(
// int data
0,
1,
12345,
-2345,
// float data
10.5,
-10.5,
10.1234567e10,
10.7654321E-10,
.5,
// array data
array(),
array(0),
array(1),
array(1, 2),
array('color' => 'red', 'item' => 'pen'),
// null data
NULL,
null,
// boolean data
true,
false,
TRUE,
FALSE,
// empty data
"",
'',
// string data
"string",
'string',
// object data
new aClass(),
// resource data
$fp,
// undefined data
$undefined_var,
// unset data
$unset_var,
);
// loop through each element of the array for parser
foreach($values as $value) {
echo @"\nArg value $value \n";
var_dump( xml_set_notation_decl_handler($value, $hdl) );
};
fclose($fp);
echo "Done";
?>
@@ -0,0 +1,114 @@
*** Testing xml_set_notation_decl_handler() : usage variations ***
Arg value 0
HipHop Warning: %a
NULL
Arg value 1
HipHop Warning: %a
NULL
Arg value 12345
HipHop Warning: %a
NULL
Arg value -2345
HipHop Warning: %a
NULL
Arg value 10.5
HipHop Warning: %a
NULL
Arg value -10.5
HipHop Warning: %a
NULL
Arg value 101234567000
HipHop Warning: %a
NULL
Arg value 1.07654321E-9
HipHop Warning: %a
NULL
Arg value 0.5
HipHop Warning: %a
NULL
Arg value Array
HipHop Warning: %a
NULL
Arg value Array
HipHop Warning: %a
NULL
Arg value Array
HipHop Warning: %a
NULL
Arg value Array
HipHop Warning: %a
NULL
Arg value Array
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value 1
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value 1
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value string
HipHop Warning: %a
NULL
Arg value string
HipHop Warning: %a
NULL
Arg value Some Ascii Data
HipHop Warning: %a
NULL
Arg value Resource id %s
HipHop Warning: %a
bool(false)
Arg value
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Done
@@ -0,0 +1,88 @@
<?php
/* Prototype : proto int xml_set_object(resource parser, object &obj)
* Description: Set up object which should be used for callbacks
* Source code: ext/xml/xml.c
* Alias to functions:
*/
echo "*** Testing xml_set_object() : usage variations ***\n";
error_reporting(E_ALL & ~E_NOTICE);
class aClass {
function __toString() {
return "Some Ascii Data";
}
}
// Initialise function arguments not being substituted (if any)
$obj = new aClass();
//get an unset variable
$unset_var = 10;
unset ($unset_var);
$fp = fopen(__FILE__, "r");
//array of values to iterate over
$values = array(
// int data
0,
1,
12345,
-2345,
// float data
10.5,
-10.5,
10.1234567e10,
10.7654321E-10,
.5,
// array data
array(),
array(0),
array(1),
array(1, 2),
array('color' => 'red', 'item' => 'pen'),
// null data
NULL,
null,
// boolean data
true,
false,
TRUE,
FALSE,
// empty data
"",
'',
// string data
"string",
'string',
// object data
new aClass(),
// resource data
$fp,
// undefined data
$undefined_var,
// unset data
$unset_var,
);
// loop through each element of the array for parser
foreach($values as $value) {
echo @"\nArg value $value \n";
var_dump( xml_set_object($value, $obj) );
};
fclose($fp);
echo "Done";
?>
@@ -0,0 +1,114 @@
*** Testing xml_set_object() : usage variations ***
Arg value 0
HipHop Warning: %a
NULL
Arg value 1
HipHop Warning: %a
NULL
Arg value 12345
HipHop Warning: %a
NULL
Arg value -2345
HipHop Warning: %a
NULL
Arg value 10.5
HipHop Warning: %a
NULL
Arg value -10.5
HipHop Warning: %a
NULL
Arg value 101234567000
HipHop Warning: %a
NULL
Arg value 1.07654321E-9
HipHop Warning: %a
NULL
Arg value 0.5
HipHop Warning: %a
NULL
Arg value Array
HipHop Warning: %a
NULL
Arg value Array
HipHop Warning: %a
NULL
Arg value Array
HipHop Warning: %a
NULL
Arg value Array
HipHop Warning: %a
NULL
Arg value Array
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value 1
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value 1
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value string
HipHop Warning: %a
NULL
Arg value string
HipHop Warning: %a
NULL
Arg value Some Ascii Data
HipHop Warning: %a
NULL
Arg value Resource id %s
HipHop Warning: %a
bool(false)
Arg value
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Done
@@ -0,0 +1,82 @@
<?php
/* Prototype : proto int xml_set_object(resource parser, object &obj)
* Description: Set up object which should be used for callbacks
* Source code: ext/xml/xml.c
* Alias to functions:
*/
echo "*** Testing xml_set_object() : usage variations ***\n";
error_reporting(E_ALL & ~E_NOTICE);
// Initialise function arguments not being substituted (if any)
$parser = xml_parser_create();
$fp = fopen(__FILE__, "r");
//get an unset variable
$unset_var = 10;
unset ($unset_var);
//array of values to iterate over
$values = array(
// int data
0,
1,
12345,
-2345,
// float data
10.5,
-10.5,
10.1234567e10,
10.7654321E-10,
.5,
// array data
array(),
array(0),
array(1),
array(1, 2),
array('color' => 'red', 'item' => 'pen'),
// null data
NULL,
null,
// boolean data
true,
false,
TRUE,
FALSE,
// empty data
"",
'',
// string data
"string",
'string',
// resource data
$fp,
// undefined data
$undefined_var,
// unset data
$unset_var,
);
// loop through each element of the array for obj
foreach($values as $value) {
echo @"\nArg value $value \n";
var_dump( xml_set_object($parser, $value) );
};
xml_parser_free($parser);
fclose($fp);
echo "Done";
?>
@@ -0,0 +1,110 @@
*** Testing xml_set_object() : usage variations ***
Arg value 0
HipHop Warning: %a
NULL
Arg value 1
HipHop Warning: %a
NULL
Arg value 12345
HipHop Warning: %a
NULL
Arg value -2345
HipHop Warning: %a
NULL
Arg value 10.5
HipHop Warning: %a
NULL
Arg value -10.5
HipHop Warning: %a
NULL
Arg value 101234567000
HipHop Warning: %a
NULL
Arg value 1.07654321E-9
HipHop Warning: %a
NULL
Arg value 0.5
HipHop Warning: %a
NULL
Arg value Array
HipHop Warning: %a
NULL
Arg value Array
HipHop Warning: %a
NULL
Arg value Array
HipHop Warning: %a
NULL
Arg value Array
HipHop Warning: %a
NULL
Arg value Array
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value 1
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value 1
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value string
HipHop Warning: %a
NULL
Arg value string
HipHop Warning: %a
NULL
Arg value Resource id %s
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Done
@@ -0,0 +1,92 @@
<?php
/* Prototype : proto int xml_set_processing_instruction_handler(resource parser, string hdl)
* Description: Set up processing instruction (PI) handler
* Source code: ext/xml/xml.c
* Alias to functions:
*/
echo "*** Testing xml_set_processing_instruction_handler() : usage variations ***\n";
error_reporting(E_ALL & ~E_NOTICE);
class aClass {
function __toString() {
return "Some Ascii Data";
}
}
function validHandler(resource $parser ,string $data) {
}
// Initialise function arguments not being substituted (if any)
$hdl = 'validHandler';
//get an unset variable
$unset_var = 10;
unset ($unset_var);
$fp = fopen(__FILE__, "r");
//array of values to iterate over
$values = array(
// int data
0,
1,
12345,
-2345,
// float data
10.5,
-10.5,
10.1234567e10,
10.7654321E-10,
.5,
// array data
array(),
array(0),
array(1),
array(1, 2),
array('color' => 'red', 'item' => 'pen'),
// null data
NULL,
null,
// boolean data
true,
false,
TRUE,
FALSE,
// empty data
"",
'',
// string data
"string",
'string',
// object data
new aClass(),
// resource data
$fp,
// undefined data
$undefined_var,
// unset data
$unset_var,
);
// loop through each element of the array for parser
foreach($values as $value) {
echo @"\nArg value $value \n";
var_dump( xml_set_processing_instruction_handler($value, $hdl) );
};
fclose($fp);
echo "Done";
?>
@@ -0,0 +1,114 @@
*** Testing xml_set_processing_instruction_handler() : usage variations ***
Arg value 0
HipHop Warning: %a
NULL
Arg value 1
HipHop Warning: %a
NULL
Arg value 12345
HipHop Warning: %a
NULL
Arg value -2345
HipHop Warning: %a
NULL
Arg value 10.5
HipHop Warning: %a
NULL
Arg value -10.5
HipHop Warning: %a
NULL
Arg value 101234567000
HipHop Warning: %a
NULL
Arg value 1.07654321E-9
HipHop Warning: %a
NULL
Arg value 0.5
HipHop Warning: %a
NULL
Arg value Array
HipHop Warning: %a
NULL
Arg value Array
HipHop Warning: %a
NULL
Arg value Array
HipHop Warning: %a
NULL
Arg value Array
HipHop Warning: %a
NULL
Arg value Array
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value 1
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value 1
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value string
HipHop Warning: %a
NULL
Arg value string
HipHop Warning: %a
NULL
Arg value Some Ascii Data
HipHop Warning: %a
NULL
Arg value Resource id %s
HipHop Warning: %a
bool(false)
Arg value
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Done
@@ -0,0 +1,41 @@
<?php
/* Prototype : bool xml_set_start_namespace_decl_handler ( resource $parser , callback $handler )
* Description: Set up start namespace declaration handler.
* Source code: ext/xml/xml.c
* Alias to functions:
*/
$xml = <<<HERE
<aw1:book xmlns:aw1="http://www.somewhere.com/namespace1"
xmlns:aw2="file:/DTD/somewhere.dtd">
<aw1:para>Any old text.</aw1:para>
<aw2:td>An HTML table cell.</aw2:td>
</aw1:book>
HERE;
$parser = xml_parser_create_ns();
xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0);
var_dump(xml_set_start_namespace_decl_handler( $parser, "Namespace_Start_Handler" ));
var_dump(xml_set_end_namespace_decl_handler( $parser, "Namespace_End_Handler" ));
xml_parse( $parser, $xml, true);
xml_parser_free( $parser );
echo "Done\n";
function Namespace_Start_Handler( $parser, $prefix, $uri ) {
echo "Namespace_Start_Handler called\n";
echo "...Prefix: ". $prefix . "\n";
echo "...Uri: ". $uri . "\n";
}
function Namespace_End_Handler($parser, $prefix) {
echo "Namespace_End_Handler called\n";
echo "...Prefix: ". $prefix . "\n\n";
}
function DefaultHandler( $parser, $data ) {
print( 'DefaultHandler Called<br/>' );
}
?>
@@ -0,0 +1,9 @@
bool(true)
bool(true)
Namespace_Start_Handler called
...Prefix: aw1
...Uri: http://www.somewhere.com/namespace1
Namespace_Start_Handler called
...Prefix: aw2
...Uri: file:/DTD/somewhere.dtd
Done
@@ -0,0 +1,92 @@
<?php
/* Prototype : proto int xml_set_start_namespace_decl_handler(resource parser, string hdl)
* Description: Set up character data handler
* Source code: ext/xml/xml.c
* Alias to functions:
*/
echo "*** Testing xml_set_start_namespace_decl_handler() : usage variations ***\n";
error_reporting(E_ALL & ~E_NOTICE);
class aClass {
function __toString() {
return "Some Ascii Data";
}
}
function validHandler(resource $parser ,string $data) {
}
// Initialise function arguments not being substituted (if any)
$hdl = 'validHandler';
//get an unset variable
$unset_var = 10;
unset ($unset_var);
$fp = fopen(__FILE__, "r");
//array of values to iterate over
$values = array(
// int data
0,
1,
12345,
-2345,
// float data
10.5,
-10.5,
10.1234567e10,
10.7654321E-10,
.5,
// array data
array(),
array(0),
array(1),
array(1, 2),
array('color' => 'red', 'item' => 'pen'),
// null data
NULL,
null,
// boolean data
true,
false,
TRUE,
FALSE,
// empty data
"",
'',
// string data
"string",
'string',
// object data
new aClass(),
// resource data
$fp,
// undefined data
$undefined_var,
// unset data
$unset_var,
);
// loop through each element of the array for parser
foreach($values as $value) {
echo @"\nArg value $value \n";
var_dump( xml_set_start_namespace_decl_handler($value, $hdl) );
};
fclose($fp);
echo "Done";
?>
@@ -0,0 +1,114 @@
*** Testing xml_set_start_namespace_decl_handler() : usage variations ***
Arg value 0
HipHop Warning: %a
NULL
Arg value 1
HipHop Warning: %a
NULL
Arg value 12345
HipHop Warning: %a
NULL
Arg value -2345
HipHop Warning: %a
NULL
Arg value 10.5
HipHop Warning: %a
NULL
Arg value -10.5
HipHop Warning: %a
NULL
Arg value 101234567000
HipHop Warning: %a
NULL
Arg value 1.07654321E-9
HipHop Warning: %a
NULL
Arg value 0.5
HipHop Warning: %a
NULL
Arg value Array
HipHop Warning: %a
NULL
Arg value Array
HipHop Warning: %a
NULL
Arg value Array
HipHop Warning: %a
NULL
Arg value Array
HipHop Warning: %a
NULL
Arg value Array
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value 1
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value 1
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value string
HipHop Warning: %a
NULL
Arg value string
HipHop Warning: %a
NULL
Arg value Some Ascii Data
HipHop Warning: %a
NULL
Arg value Resource id %s
HipHop Warning: %a
bool(false)
Arg value
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Done
@@ -0,0 +1,92 @@
<?php
/* Prototype : proto int xml_set_unparsed_entity_decl_handler(resource parser, string hdl)
* Description: Set up unparsed entity declaration handler
* Source code: ext/xml/xml.c
* Alias to functions:
*/
echo "*** Testing xml_set_unparsed_entity_decl_handler() : usage variations ***\n";
error_reporting(E_ALL & ~E_NOTICE);
class aClass {
function __toString() {
return "Some Ascii Data";
}
}
function validHandler(resource $parser ,string $data) {
}
// Initialise function arguments not being substituted (if any)
$hdl = 'validHandler';
//get an unset variable
$unset_var = 10;
unset ($unset_var);
$fp = fopen(__FILE__, "r");
//array of values to iterate over
$values = array(
// int data
0,
1,
12345,
-2345,
// float data
10.5,
-10.5,
10.1234567e10,
10.7654321E-10,
.5,
// array data
array(),
array(0),
array(1),
array(1, 2),
array('color' => 'red', 'item' => 'pen'),
// null data
NULL,
null,
// boolean data
true,
false,
TRUE,
FALSE,
// empty data
"",
'',
// string data
"string",
'string',
// object data
new aClass(),
// resource data
$fp,
// undefined data
$undefined_var,
// unset data
$unset_var,
);
// loop through each element of the array for parser
foreach($values as $value) {
echo @"\nArg value $value \n";
var_dump( xml_set_unparsed_entity_decl_handler($value, $hdl) );
};
fclose($fp);
echo "Done";
?>
@@ -0,0 +1,114 @@
*** Testing xml_set_unparsed_entity_decl_handler() : usage variations ***
Arg value 0
HipHop Warning: %a
NULL
Arg value 1
HipHop Warning: %a
NULL
Arg value 12345
HipHop Warning: %a
NULL
Arg value -2345
HipHop Warning: %a
NULL
Arg value 10.5
HipHop Warning: %a
NULL
Arg value -10.5
HipHop Warning: %a
NULL
Arg value 101234567000
HipHop Warning: %a
NULL
Arg value 1.07654321E-9
HipHop Warning: %a
NULL
Arg value 0.5
HipHop Warning: %a
NULL
Arg value Array
HipHop Warning: %a
NULL
Arg value Array
HipHop Warning: %a
NULL
Arg value Array
HipHop Warning: %a
NULL
Arg value Array
HipHop Warning: %a
NULL
Arg value Array
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value 1
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value 1
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Arg value string
HipHop Warning: %a
NULL
Arg value string
HipHop Warning: %a
NULL
Arg value Some Ascii Data
HipHop Warning: %a
NULL
Arg value Resource id %s
HipHop Warning: %a
bool(false)
Arg value
HipHop Warning: %a
NULL
Arg value
HipHop Warning: %a
NULL
Done
+23
Ver Arquivo
@@ -0,0 +1,23 @@
<?php
function start_elem($parser,$name,$attribs) {
var_dump($name);
}
function end_elem()
{
}
$xml = <<<HERE
<foo:a xmlns:foo="http://example.com/foo"
xmlns:bar="http://example.com/bar"
xmlns:baz="http://example.com/baz">
<bar:b />
<baz:c />
</foo>
HERE;
$parser = xml_parser_create_ns("ISO-8859-1","@");
xml_set_element_handler($parser,'start_elem','end_elem');
xml_parser_set_option($parser,XML_OPTION_CASE_FOLDING,0);
xml_parse($parser, $xml);
xml_parser_free($parser);
?>
@@ -0,0 +1,3 @@
string(24) "http://example.com/foo@a"
string(24) "http://example.com/bar@b"
string(24) "http://example.com/baz@c"
+75
Ver Arquivo
@@ -0,0 +1,75 @@
<?php
/*
this test works fine with Expat but fails with libxml
which we now use as default
further investigation has shown that not only line count
is skippet on CDATA sections but that libxml does also
show different column numbers and byte positions depending
on context and in opposition to what one would expect to
see and what good old Expat reported just fine ...
*/
$xmls = array();
// Case 1: CDATA Sections
$xmls["CDATA"] ='<?xml version="1.0" encoding="iso-8859-1" ?>
<data>
<![CDATA[
multi
line
CDATA
block
]]>
</data>';
// Case 2: replace some characters so that we get comments instead
$xmls["Comment"] ='<?xml version="1.0" encoding="iso-8859-1" ?>
<data>
<!-- ATA[
multi
line
CDATA
block
-->
</data>';
// Case 3: replace even more characters so that only textual data is left
$xmls["Text"] ='<?xml version="1.0" encoding="iso-8859-1" ?>
<data>
-!-- ATA[
multi
line
CDATA
block
---
</data>';
function startElement($parser, $name, $attrs) {
printf("<$name> at line %d, col %d (byte %d)\n",
xml_get_current_line_number($parser),
xml_get_current_column_number($parser),
xml_get_current_byte_index($parser));
}
function endElement($parser, $name) {
printf("</$name> at line %d, col %d (byte %d)\n",
xml_get_current_line_number($parser),
xml_get_current_column_number($parser),
xml_get_current_byte_index($parser));
}
function characterData($parser, $data) {
// dummy
}
foreach ($xmls as $desc => $xml) {
echo "$desc\n";
$xml_parser = xml_parser_create();
xml_set_element_handler($xml_parser, "startElement", "endElement");
xml_set_character_data_handler($xml_parser, "characterData");
if (!xml_parse($xml_parser, $xml, true))
echo "Error: ".xml_error_string(xml_get_error_code($xml_parser))."\n";
xml_parser_free($xml_parser);
}
?>
@@ -0,0 +1,9 @@
CDATA
<DATA> at line 2, col 0 (byte 45)
</DATA> at line 9, col 0 (byte 90)
Comment
<DATA> at line 2, col 0 (byte 45)
</DATA> at line 9, col 0 (byte 90)
Text
<DATA> at line 2, col 0 (byte 45)
</DATA> at line 9, col 0 (byte 90)
+12
Ver Arquivo
@@ -0,0 +1,12 @@
<?php
function x_default_handler($xp,$data)
{
echo "x_default_handler $data\n";
}
$xp = xml_parser_create();
xml_set_default_handler($xp,'x_default_handler');
xml_parse($xp, '<root></root>',TRUE);
xml_parser_free($xp);
echo "Done\n";
?>
@@ -0,0 +1,3 @@
x_default_handler <root>
x_default_handler </root>
Done
+43
Ver Arquivo
@@ -0,0 +1,43 @@
<?php
/*
Currently (Feb 10, 2005) CVS HEAD fails with the following message:
Fatal error: Invalid opcode 137/1/8. in /home/hartmut/projects/php/dev/head/ext/xml/tests/bug30266.php on line 22
*/
class XML_Parser
{
public $dummy = "a";
function parse($data)
{
$parser = xml_parser_create();
xml_set_object($parser, $this);
xml_set_element_handler($parser, 'startHandler', 'endHandler');
xml_parse($parser, $data, true);
xml_parser_free($parser);
}
function startHandler($XmlParser, $tag, $attr)
{
$this->dummy = "b";
throw new Exception("ex");
}
function endHandler($XmlParser, $tag)
{
}
}
$p1 = new Xml_Parser();
try {
$p1->parse('<tag1><tag2></tag2></tag1>');
} catch (Exception $e) {
echo "OK\n";
}
?>
@@ -0,0 +1 @@
OK
+156
Ver Arquivo
@@ -0,0 +1,156 @@
<?php
class testcase {
private $encoding;
private $bom;
private $prologue;
private $tags;
private $chunk_size;
function testcase($enc, $chunk_size = 0, $bom = 0, $omit_prologue = 0) {
$this->encoding = $enc;
$this->chunk_size = $chunk_size;
$this->bom = $bom;
$this->prologue = !$omit_prologue;
$this->tags = array();
}
function start_element($parser, $name, $attrs) {
$attrs = array_map('bin2hex', $attrs);
$this->tags[] = bin2hex($name).": ".implode(', ', $attrs);
}
function end_element($parser, $name) {
}
function run() {
$data = '';
if ($this->prologue) {
$canonical_name = preg_replace('/BE|LE/i', '', $this->encoding);
$data .= "<?xml version=\"1.0\" encoding=\"$canonical_name\" ?>\n";
}
$data .= <<<HERE
<テスト:テスト1 xmlns:テスト="http://www.example.com/テスト/" テスト="テスト">
<テスト:テスト2 テスト="テスト">
<テスト:テスト3>
test!
</テスト:テスト3>
</テスト:テスト2>
</テスト:テスト1>
HERE;
$data = iconv("UTF-8", $this->encoding, $data);
if ($this->bom) {
switch (strtoupper($this->encoding)) {
case 'UTF-8':
case 'UTF8':
$data = "\xef\xbb\xbf".$data;
break;
case 'UTF-16':
case 'UTF16':
case 'UTF-16BE':
case 'UTF16BE':
case 'UCS-2':
case 'UCS2':
case 'UCS-2BE':
case 'UCS2BE':
$data = "\xfe\xff".$data;
break;
case 'UTF-16LE':
case 'UTF16LE':
case 'UCS-2LE':
case 'UCS2LE':
$data = "\xff\xfe".$data;
break;
case 'UTF-32':
case 'UTF32':
case 'UTF-32BE':
case 'UTF32BE':
case 'UCS-4':
case 'UCS4':
case 'UCS-4BE':
case 'UCS4BE':
$data = "\x00\x00\xfe\xff".$data;
break;
case 'UTF-32LE':
case 'UTF32LE':
case 'UCS-4LE':
case 'UCS4LE':
$data = "\xff\xfe\x00\x00".$data;
break;
}
}
$parser = xml_parser_create(NULL);
xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0);
xml_set_element_handler($parser, "start_element", "end_element");
xml_set_object($parser, $this);
if ($this->chunk_size == 0) {
$success = @xml_parse($parser, $data, true);
} else {
for ($offset = 0; $offset < strlen($data);
$offset += $this->chunk_size) {
$success = @xml_parse($parser, substr($data, $offset, $this->chunk_size), false);
if (!$success) {
break;
}
}
if ($success) {
$success = @xml_parse($parser, "", true);
}
}
echo "Encoding: $this->encoding\n";
echo "XML Prologue: ".($this->prologue ? 'present': 'not present'), "\n";
echo "Chunk size: ".($this->chunk_size ? "$this->chunk_size byte(s)\n": "all data at once\n");
echo "BOM: ".($this->bom ? 'prepended': 'not prepended'), "\n";
if ($success) {
var_dump($this->tags);
} else {
echo "[Error] ", xml_error_string(xml_get_error_code($parser)), "\n";
}
}
}
$suite = array(
new testcase("UTF-8", 0, 0, 0),
new testcase("UTF-8", 0, 0, 1),
new testcase("UTF-8", 0, 1, 0),
new testcase("UTF-8", 0, 1, 1),
new testcase("UTF-16BE", 0, 0, 0),
new testcase("UTF-16BE", 0, 1, 0),
new testcase("UTF-16BE", 0, 1, 1),
new testcase("UTF-16LE", 0, 0, 0),
new testcase("UTF-16LE", 0, 1, 0),
new testcase("UTF-16LE", 0, 1, 1),
new testcase("UTF-8", 1, 0, 0),
new testcase("UTF-8", 1, 0, 1),
new testcase("UTF-8", 1, 1, 0),
new testcase("UTF-8", 1, 1, 1),
new testcase("UTF-16BE", 1, 0, 0),
new testcase("UTF-16BE", 1, 1, 0),
new testcase("UTF-16BE", 1, 1, 1),
new testcase("UTF-16LE", 1, 0, 0),
new testcase("UTF-16LE", 1, 1, 0),
new testcase("UTF-16LE", 1, 1, 1),
);
if (XML_SAX_IMPL == 'libxml') {
echo "libxml2 Version => " . LIBXML_DOTTED_VERSION. "\n";
} else {
echo "libxml2 Version => NONE\n";
}
foreach ($suite as $testcase) {
$testcase->run();
}
// vim600: sts=4 sw=4 ts=4 encoding=UTF-8
?>
@@ -0,0 +1,241 @@
libxml2 Version => %s
Encoding: UTF-8
XML Prologue: present
Chunk size: all data at once
BOM: not prepended
array(3) {
[0]=>
string(128) "e38386e382b9e383883ae38386e382b9e3838831: 687474703a2f2f7777772e6578616d706c652e636f6d2fe38386e382b9e383882f, e38386e382b9e38388"
[1]=>
string(60) "e38386e382b9e383883ae38386e382b9e3838832: e38386e382b9e38388"
[2]=>
string(42) "e38386e382b9e383883ae38386e382b9e3838833: "
}
Encoding: UTF-8
XML Prologue: not present
Chunk size: all data at once
BOM: not prepended
array(3) {
[0]=>
string(128) "e38386e382b9e383883ae38386e382b9e3838831: 687474703a2f2f7777772e6578616d706c652e636f6d2fe38386e382b9e383882f, e38386e382b9e38388"
[1]=>
string(60) "e38386e382b9e383883ae38386e382b9e3838832: e38386e382b9e38388"
[2]=>
string(42) "e38386e382b9e383883ae38386e382b9e3838833: "
}
Encoding: UTF-8
XML Prologue: present
Chunk size: all data at once
BOM: prepended
array(3) {
[0]=>
string(128) "e38386e382b9e383883ae38386e382b9e3838831: 687474703a2f2f7777772e6578616d706c652e636f6d2fe38386e382b9e383882f, e38386e382b9e38388"
[1]=>
string(60) "e38386e382b9e383883ae38386e382b9e3838832: e38386e382b9e38388"
[2]=>
string(42) "e38386e382b9e383883ae38386e382b9e3838833: "
}
Encoding: UTF-8
XML Prologue: not present
Chunk size: all data at once
BOM: prepended
array(3) {
[0]=>
string(128) "e38386e382b9e383883ae38386e382b9e3838831: 687474703a2f2f7777772e6578616d706c652e636f6d2fe38386e382b9e383882f, e38386e382b9e38388"
[1]=>
string(60) "e38386e382b9e383883ae38386e382b9e3838832: e38386e382b9e38388"
[2]=>
string(42) "e38386e382b9e383883ae38386e382b9e3838833: "
}
Encoding: UTF-16BE
XML Prologue: present
Chunk size: all data at once
BOM: not prepended
array(3) {
[0]=>
string(128) "e38386e382b9e383883ae38386e382b9e3838831: 687474703a2f2f7777772e6578616d706c652e636f6d2fe38386e382b9e383882f, e38386e382b9e38388"
[1]=>
string(60) "e38386e382b9e383883ae38386e382b9e3838832: e38386e382b9e38388"
[2]=>
string(42) "e38386e382b9e383883ae38386e382b9e3838833: "
}
Encoding: UTF-16BE
XML Prologue: present
Chunk size: all data at once
BOM: prepended
array(3) {
[0]=>
string(128) "e38386e382b9e383883ae38386e382b9e3838831: 687474703a2f2f7777772e6578616d706c652e636f6d2fe38386e382b9e383882f, e38386e382b9e38388"
[1]=>
string(60) "e38386e382b9e383883ae38386e382b9e3838832: e38386e382b9e38388"
[2]=>
string(42) "e38386e382b9e383883ae38386e382b9e3838833: "
}
Encoding: UTF-16BE
XML Prologue: not present
Chunk size: all data at once
BOM: prepended
array(3) {
[0]=>
string(128) "e38386e382b9e383883ae38386e382b9e3838831: 687474703a2f2f7777772e6578616d706c652e636f6d2fe38386e382b9e383882f, e38386e382b9e38388"
[1]=>
string(60) "e38386e382b9e383883ae38386e382b9e3838832: e38386e382b9e38388"
[2]=>
string(42) "e38386e382b9e383883ae38386e382b9e3838833: "
}
Encoding: UTF-16LE
XML Prologue: present
Chunk size: all data at once
BOM: not prepended
array(3) {
[0]=>
string(128) "e38386e382b9e383883ae38386e382b9e3838831: 687474703a2f2f7777772e6578616d706c652e636f6d2fe38386e382b9e383882f, e38386e382b9e38388"
[1]=>
string(60) "e38386e382b9e383883ae38386e382b9e3838832: e38386e382b9e38388"
[2]=>
string(42) "e38386e382b9e383883ae38386e382b9e3838833: "
}
Encoding: UTF-16LE
XML Prologue: present
Chunk size: all data at once
BOM: prepended
array(3) {
[0]=>
string(128) "e38386e382b9e383883ae38386e382b9e3838831: 687474703a2f2f7777772e6578616d706c652e636f6d2fe38386e382b9e383882f, e38386e382b9e38388"
[1]=>
string(60) "e38386e382b9e383883ae38386e382b9e3838832: e38386e382b9e38388"
[2]=>
string(42) "e38386e382b9e383883ae38386e382b9e3838833: "
}
Encoding: UTF-16LE
XML Prologue: not present
Chunk size: all data at once
BOM: prepended
array(3) {
[0]=>
string(128) "e38386e382b9e383883ae38386e382b9e3838831: 687474703a2f2f7777772e6578616d706c652e636f6d2fe38386e382b9e383882f, e38386e382b9e38388"
[1]=>
string(60) "e38386e382b9e383883ae38386e382b9e3838832: e38386e382b9e38388"
[2]=>
string(42) "e38386e382b9e383883ae38386e382b9e3838833: "
}
Encoding: UTF-8
XML Prologue: present
Chunk size: 1 byte(s)
BOM: not prepended
array(3) {
[0]=>
string(128) "e38386e382b9e383883ae38386e382b9e3838831: 687474703a2f2f7777772e6578616d706c652e636f6d2fe38386e382b9e383882f, e38386e382b9e38388"
[1]=>
string(60) "e38386e382b9e383883ae38386e382b9e3838832: e38386e382b9e38388"
[2]=>
string(42) "e38386e382b9e383883ae38386e382b9e3838833: "
}
Encoding: UTF-8
XML Prologue: not present
Chunk size: 1 byte(s)
BOM: not prepended
array(3) {
[0]=>
string(128) "e38386e382b9e383883ae38386e382b9e3838831: 687474703a2f2f7777772e6578616d706c652e636f6d2fe38386e382b9e383882f, e38386e382b9e38388"
[1]=>
string(60) "e38386e382b9e383883ae38386e382b9e3838832: e38386e382b9e38388"
[2]=>
string(42) "e38386e382b9e383883ae38386e382b9e3838833: "
}
Encoding: UTF-8
XML Prologue: present
Chunk size: 1 byte(s)
BOM: prepended
array(3) {
[0]=>
string(128) "e38386e382b9e383883ae38386e382b9e3838831: 687474703a2f2f7777772e6578616d706c652e636f6d2fe38386e382b9e383882f, e38386e382b9e38388"
[1]=>
string(60) "e38386e382b9e383883ae38386e382b9e3838832: e38386e382b9e38388"
[2]=>
string(42) "e38386e382b9e383883ae38386e382b9e3838833: "
}
Encoding: UTF-8
XML Prologue: not present
Chunk size: 1 byte(s)
BOM: prepended
array(3) {
[0]=>
string(128) "e38386e382b9e383883ae38386e382b9e3838831: 687474703a2f2f7777772e6578616d706c652e636f6d2fe38386e382b9e383882f, e38386e382b9e38388"
[1]=>
string(60) "e38386e382b9e383883ae38386e382b9e3838832: e38386e382b9e38388"
[2]=>
string(42) "e38386e382b9e383883ae38386e382b9e3838833: "
}
Encoding: UTF-16BE
XML Prologue: present
Chunk size: 1 byte(s)
BOM: not prepended
array(3) {
[0]=>
string(128) "e38386e382b9e383883ae38386e382b9e3838831: 687474703a2f2f7777772e6578616d706c652e636f6d2fe38386e382b9e383882f, e38386e382b9e38388"
[1]=>
string(60) "e38386e382b9e383883ae38386e382b9e3838832: e38386e382b9e38388"
[2]=>
string(42) "e38386e382b9e383883ae38386e382b9e3838833: "
}
Encoding: UTF-16BE
XML Prologue: present
Chunk size: 1 byte(s)
BOM: prepended
array(3) {
[0]=>
string(128) "e38386e382b9e383883ae38386e382b9e3838831: 687474703a2f2f7777772e6578616d706c652e636f6d2fe38386e382b9e383882f, e38386e382b9e38388"
[1]=>
string(60) "e38386e382b9e383883ae38386e382b9e3838832: e38386e382b9e38388"
[2]=>
string(42) "e38386e382b9e383883ae38386e382b9e3838833: "
}
Encoding: UTF-16BE
XML Prologue: not present
Chunk size: 1 byte(s)
BOM: prepended
array(3) {
[0]=>
string(128) "e38386e382b9e383883ae38386e382b9e3838831: 687474703a2f2f7777772e6578616d706c652e636f6d2fe38386e382b9e383882f, e38386e382b9e38388"
[1]=>
string(60) "e38386e382b9e383883ae38386e382b9e3838832: e38386e382b9e38388"
[2]=>
string(42) "e38386e382b9e383883ae38386e382b9e3838833: "
}
Encoding: UTF-16LE
XML Prologue: present
Chunk size: 1 byte(s)
BOM: not prepended
array(3) {
[0]=>
string(128) "e38386e382b9e383883ae38386e382b9e3838831: 687474703a2f2f7777772e6578616d706c652e636f6d2fe38386e382b9e383882f, e38386e382b9e38388"
[1]=>
string(60) "e38386e382b9e383883ae38386e382b9e3838832: e38386e382b9e38388"
[2]=>
string(42) "e38386e382b9e383883ae38386e382b9e3838833: "
}
Encoding: UTF-16LE
XML Prologue: present
Chunk size: 1 byte(s)
BOM: prepended
array(3) {
[0]=>
string(128) "e38386e382b9e383883ae38386e382b9e3838831: 687474703a2f2f7777772e6578616d706c652e636f6d2fe38386e382b9e383882f, e38386e382b9e38388"
[1]=>
string(60) "e38386e382b9e383883ae38386e382b9e3838832: e38386e382b9e38388"
[2]=>
string(42) "e38386e382b9e383883ae38386e382b9e3838833: "
}
Encoding: UTF-16LE
XML Prologue: not present
Chunk size: 1 byte(s)
BOM: prepended
array(3) {
[0]=>
string(128) "e38386e382b9e383883ae38386e382b9e3838831: 687474703a2f2f7777772e6578616d706c652e636f6d2fe38386e382b9e383882f, e38386e382b9e38388"
[1]=>
string(60) "e38386e382b9e383883ae38386e382b9e3838832: e38386e382b9e38388"
[2]=>
string(42) "e38386e382b9e383883ae38386e382b9e3838833: "
}

Alguns arquivos não foram exibidos porque demasiados arquivos foram alterados neste diff Mostrar Mais