Skip to content

documentElement not being created on Power9 #12892

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
alecpl opened this issue Dec 7, 2023 · 2 comments
Closed

documentElement not being created on Power9 #12892

alecpl opened this issue Dec 7, 2023 · 2 comments

Comments

@alecpl
Copy link

alecpl commented Dec 7, 2023

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

@nielsdos
Copy link
Member

nielsdos commented Dec 7, 2023

This reminds me of #12215 which is fixed some time ago, but not in 8.0.x.
I don't own POWER9 hardware, and before I try to get into emulation: can you please try the latest 8.1 or higher on your hardware to see if it is the same issues (that is already fixed)?

@alecpl
Copy link
Author

alecpl commented Dec 7, 2023

@nielsdos Thank you very much. It is indeed the same issue. Something went wrong on package updates and we indeed loaded some extensions twice. Fixing that fixed the issue. So, it has nothing to do with the architecture after all.

And I've seen that ticket some time ago, but didn't found it when searching for solutions. Thanks man, and thank you for all the work you do on PHP.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants