diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index f743917..c7e1089 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -21,6 +21,7 @@ jobs: uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php with: php-version: ${{ matrix.php-versions }} + ini-values: error_reporting=E_ALL extensions: mbstring, xml tools: composer:v2 coverage: pcov diff --git a/src/DOMDocumentFactory.php b/src/DOMDocumentFactory.php index fe25eb0..a953014 100644 --- a/src/DOMDocumentFactory.php +++ b/src/DOMDocumentFactory.php @@ -33,7 +33,9 @@ public static function fromString(string $xml): DOMDocument { Assert::stringNotEmpty(trim($xml)); - $entityLoader = libxml_disable_entity_loader(true); + if (\PHP_VERSION_ID < 80000) { + $entityLoader = libxml_disable_entity_loader(true); + } $internalErrors = libxml_use_internal_errors(true); libxml_clear_errors(); @@ -46,7 +48,9 @@ public static function fromString(string $xml): DOMDocument $loaded = $domDocument->loadXML($xml, $options); libxml_use_internal_errors($internalErrors); - libxml_disable_entity_loader($entityLoader); + if (\PHP_VERSION_ID < 80000) { + libxml_disable_entity_loader($entityLoader); + } if (!$loaded) { $error = libxml_get_last_error();