Skip to content

Wrong default value of DOMDocument.xmlStandalone #11791

@uuf6429

Description

@uuf6429

The documentation here says that xmlStandalone defaults to false when missing, but the following test fails on PHP 8.1*:

    public function testThatStandaloneDefaultsToFalse(): void
    {
        $doc = new \DOMDocument();

        $doc->loadXML('<?xml version="1.0" encoding="US-ASCII"?><root/>');

        $this->assertFalse($doc->xmlStandalone);
    }

* I haven't tried it on other PHP versions and 3v4l.org sadly misses DOMDocument..

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions