libxml_disable_entity_loader()

libxml_disable_entity_loader() — Disable the ability to load external entities.

Built-in function of PHP 8.5. The manual lists it as available in PHP 5 >= 5.2.11, PHP 7, PHP 8. This page is the reference card: signature, parameters and return value, plus the changelog and the example the manual provides.

The PHP manual marks this function as deprecated (since PHP 8.0, as external entity loading is disabled by default): do not use it in new code.

What it does

Disable/enable the ability to load external entities. Note that disabling the loading of external entities may cause general issues with loading XML documents.

Signature

libxml_disable_entity_loader(bool $disable = true): bool

Parameters

ParameterTypeWhat it takes
$disableboolDisable (true) or enable (false) libxml extensions (such as DOM, XMLWriter and XMLReader) to load external entities.

Return value

Returns the previous value.

Example

The PHP manual ships no example for libxml_disable_entity_loader(); the signature and the parameter table above are the contract.

Changelog

VersionChange
8.0.0This function has been deprecated.

See also

libxml_use_internal_errors(), libxml_set_external_entity_loader()

All PHP 8.5 built-in functions

Reference card built from the PHP manual page libxml_disable_entity_loader() (PHP documentation, CC BY 3.0). The page is generated from the manual, so the wording of the parameter and return value text follows php.net.