5

The constant XML_PARSE_HUGE can be passed as the third argument to simplexml_load_string(). According to to php.net this flag:

relaxes any hardcoded limit from the parser.

What is the "default hardcoded limit from the parser"?

I think relaxes is a little bit ambiguous also. Does it eliminate or increase "the hardcoded limit"?

2 Answers 2

4

From http://bugs.php.net/49660:

Since version 2.7.3 libxml limits the maximum size of a single text node to 10MB. The limit can be removed with a new option, XML_PARSE_HUGE. PHP has no way to specify this option to libxml.

So I imagine this flag is the way that PHP now has to specify this option.

Sign up to request clarification or add additional context in comments.

Comments

3

time has moved: http://php.net/manual/en/libxml.constants.php

LIBXML_PARSEHUGE - Sets XML_PARSE_HUGE flag, which relaxes any hardcoded limit from the parser. This affects limits like maximum depth of a document or the entity recursion, as well as limits of the size of text nodes.
Only available in Libxml >= 2.7.0 (as of PHP >= *5.3.2 and PHP >= 5.2.12)*

//example of use
$xmlDoc = new DOMDocument();
$xmlDoc->loadXML( $xml , LIBXML_PARSEHUGE );

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.