php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #25803 xml_get_current_byte_index() always returns 0 on PHP 5.x
Submitted: 2003-10-09 09:11 UTC Modified: 2004-01-08 22:56 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: j dot spit at uptime dot nl Assigned: moriyoshi (profile)
Status: Closed Package: XML related
PHP Version: 5CVS-2003-10-10 OS: *
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: j dot spit at uptime dot nl
New email:
PHP Version: OS:

 

 [2003-10-09 09:11 UTC] 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.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-11-24 01:10 UTC] moriyoshi@php.net
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.

 [2003-11-26 16:07 UTC] j dot spit at uptime dot nl
Hi,

I noticed that in the latest CVS version it does not return zero anymore, which is good, but on the other hand it does return different values compared to php5.0.0b1. Can you enlighten me as to what value it currently returns ?

Thanks.
 [2004-01-08 11:25 UTC] j dot spit at uptime dot nl
Hello,

I am trying to find out what the current behaviour of xml_get_current_byte_index() is in PHP5 version beta3 and above. Is this documented somewhere ? I am developing software that is highly dependant on this function.

Thanks !
 [2004-01-08 22:56 UTC] sniper@php.net
current behaviour is the correct one as Moriyoshi said in his closing comment..

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 14:01:28 2024 UTC