|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2002-10-16 15:25 UTC] iliaa@php.net
[2003-08-09 15:04 UTC] rrichards@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Nov 02 11:00:01 2025 UTC |
<?php /* BUG in PHP 4.2.1: Leading white space is lost inside processing-instruction data, prior to first character after pi-target output is: bug php 4.2.1 bugpi_data=hello end_pi_data output SHOULD be: bug php 4.2.1 bug pi_data= hello end_pi_data */ /// CODE TO REPRODUCE BUG $q = '?'; $xmlSource = <<< EOD <{$q}xml version="1.0"{$q}> <bug> php 4.2.1 </bug> <{$q}php hello {$q}> EOD; $parser = xml_parser_create(); xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0); // this doesn't do anything: xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 0); xml_set_element_handler($parser, "start_element", "stop_element"); xml_set_character_data_handler($parser, "char_data"); xml_set_processing_instruction_handler( $parser, "_handlePI"); xml_parse( $parser, $xmlSource ); function _handlePI($parser, $target, $data) { echo("pi_data=".$data."end_pi_data"); exit; } function start_element($parser, $data, $attribs) { echo $data; } function stop_element($parser, $data ) { echo $data; } function char_data($parser, $data ) { echo $data; } ?>