| 
        php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits             
             [2016-02-15 00:39 UTC] anrdaemon at freemail dot ru
  [2017-07-22 22:02 UTC] kalle@php.net
 
-Status: Open
+Status: Not a bug
  [2017-07-22 22:02 UTC] kalle@php.net
  | 
    |||||||||||||||||||||||||||||||||||||
            
                 
                Copyright © 2001-2025 The PHP GroupAll rights reserved.  | 
        Last updated: Tue Nov 04 14:00:01 2025 UTC | 
Description: ------------ I am working with socket streams and the XMPP protocol. In a while it happens that a connection has to be replaced with a new one. This can be done with sending the root node again to the server, and the server then replies with a new root node too. This root node includes the XML declaration (<?xml ... ?>), but apparently the parser seems to stop at that point, where a new XML declaration occurs. So I have to filter those strings out manually, that's not the expected behavior I wished to have. This has been tested with PHP 5.3.5 and 5.3.9 Test script: --------------- <?php $p = xml_parser_create(); xml_set_element_handler($p, 'open', 'close'); function open($p, $tag) { echo "opened tag $tag\n"; } function close($p, $tag) { echo "closed tag $tag\n"; } $xml = "<?xml version='1.0' ?><stream><tag></tag>"; $xml2 = '</stream>'; xml_parse($p, $xml); xml_parse($p, $xml); xml_parse($p, $xml2); Expected result: ---------------- opened tag STREAM opened tag TAG closed tag TAG opened tag STREAM opened tag TAG closed tag TAG closed tag STREAM Actual result: -------------- opened tag STREAM opened tag TAG closed tag TAG