#25803 [Asn->Csd]: xml_get_current_byte_index() always returns 0 on PHP 5.x
ID: 25803
Updated by: moriyoshi@php.net
Reported By: j dot spit at uptime dot nl
-Status: Assigned
+Status: Closed
Bug Type: XML related
Operating System: Irrelevant
PHP Version: 5CVS-2003-10-10
Assigned To: moriyoshi
New Comment:
This bug has been fixed in CVS.
In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.
In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
Thank you for the report, and for helping us make PHP better.
Behaviour of xml_get_current_byte_index() is subject to
change in php 5.0. It would probably return the end
position of the portion that has just been parsed, by
contrast to the old behaviour in 4.x, where it returns
the start position of the portion being parsed.
Previous Comments:
------------------------------------------------------------------------
[2003-11-19 11:30:31] j dot spit at uptime dot nl
Have the same problem on Linux as well now, when using PHP5.0.0b2.
Any update yet ?
------------------------------------------------------------------------
[2003-10-09 09:11:55] j dot spit at uptime dot nl
Description:
------------
xml_get_current_byte_index always returns 0 on windows xp, it works
fine on Linux systems. Using PHP5 beta 1 on both platforms.
Reproduce code:
---------------
<?php
function startElement($parser,$name,$attribs) {
echo "Start : ".xml_get_current_byte_index( $parser )."<br>";
}
function endElement($parser,$name) {
echo "End : ".xml_get_current_byte_index( $parser )."<br>";
}
$parser = xml_parser_create();
xml_set_element_handler($parser,'startElement','endElement');
xml_parser_set_option($parser,XML_OPTION_CASE_FOLDING,0);
xml_parse($parser,
"<a b=\"x\">test<c>blaat</c></a>");
xml_parser_free($parser);
?>
Expected result:
----------------
Start : 0
Start : 13
End : 21
End : 25
This is the output on a Linux system.
Actual result:
--------------
Start : 0
Start : 0
End : 0
End : 0
This is the output on a Windows XP system.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=25803&edit=1
Thread (7 messages)