|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #46987 Maximum String Length for XML Nodes is not documented
Submitted: 2009-01-01 17:42 UTC Modified: 2009-01-14 01:00 UTC
Avg. Score:5.0 ± 0.0
Reproduced:1 of 2 (50.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: eric at midkotasolutions dot com Assigned: rrichards (profile)
Status: No Feedback Package: Documentation problem
PHP Version: 5.2.8 OS: RedHat E5
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
Solve the problem:
38 + 29 = ?
Subscribe to this entry?

 [2009-01-01 17:42 UTC] eric at midkotasolutions dot com
Note that there is a limitation to the maximum size of a string for a 
node.  I am submitting here in as documentation.

I have a string that is 455K in Size.  I tried creating an XML Node 
with this string as it's value, but the string always gets cut off at 
about 83K - 

I attempted using both the nodeValue property, and by creating a new 

Reproduce code:

To replicate, create a string that is greater than 83K (or so) - 

$string="text that is really big"

$node=new DOMText($string);

echo $node->wholeText;


The echo'd value will be cut off at about 83K

Expected result:
Is there a reason for the limitation? - Or, is this a bug?


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2009-01-02 02:30 UTC]
Rob, can you clarify whether that's an PHP or libxml2 limitation? Thanks.
 [2009-01-06 10:50 UTC]
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc. If the script requires a 
database to demonstrate the issue, please make sure it creates 
all necessary tables, stored procedures etc.

Please avoid embedding huge scripts into the report.

I cannot reproduce this.
Using a script similar to what you posted, I hit no 
limitation on string length. Was easily able to write/read using a 
string 300K long. Are you able to duplicate this on other platforms as 
 [2009-01-14 01:00 UTC] doc-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed May 22 19:01:31 2024 UTC