Closed
Description
Description
The following code that worked some time ago, stopped working. We tried PHP 8.0.27 and 8.0.30:
<?php
$nameSpace = "uri:FolderHierarchy";
$tag = "FolderSync";
$imp = new DOMImplementation();
$dtd = $imp->createDocumentType('AirSync', "-//AIRSYNC//DTD AirSync//EN", "http://www.microsoft.com/");
$dom = $imp->createDocument($nameSpace, $tag, $dtd);
// $dom->createElementNS($nameSpace, $tag); // this does not help
echo ($dom->documentElement ? 'GOOD' : 'BAD');
Resulted in this output:
PHP Warning: Undefined property: DOMDocument::$documentElement
BAD
But I expected this output instead:
GOOD
Source : php-8.0.27-1.el9_1.src.rpm
From repo : rhel-9-for-ppc64le-appstream-rpms
Linux 5.14.0-284.18.1.el9_2.ppc64le #1 SMP Wed May 31 10:42:31 EDT 2023 ppc64le ppc64le ppc64le GNU/Linux
Such code works as expected on PHP 8.0.30 (and more recent versions) x86.
PHP Version
8.0.30
Operating System
RHEL/Alma 9