Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Error: Couldn't fetch DOMElement introduced in 8.2.6, 8.1.19 #11288

Closed
ThePHPF/thephp.foundation
#90
@fluffycondor

Description

@fluffycondor

Description

Live reproduce:https://3v4l.org/iPl83

The following code:

<?php$html =<<<HTML<!DOCTYPE HTML><html><span><i><span>Lorem</span></i><span>ipsum</span></span></html>HTML;$dom =newDOMDocument();$dom->loadHTML($html);$spans =iterator_to_array($dom->getElementsByTagName('span')->getIterator());foreach ($spansas$span) {if ('unwrap_me' ===$span->getAttribute('class')) {$fragment =$dom->createDocumentFragment();$fragment->append(...$span->childNodes);$span->parentNode?->replaceChild($fragment,$span);    }}

worked successfully as for 8.2.5, 8.1.18 and earlier.
But as for 8.2.6 and 8.1.19 it throwsError: Couldn't fetch DOMElement because one of DOMElement's state is corrupted:

object(DOMElement)#142 (1) {  ["schemaTypeInfo"]=>  NULL}DOMElement Object(    [schemaTypeInfo] =>)

PHP Version

PHP 8.2.6, 8.1.19

Operating System

FreeBSD 12.4, Windows 10 x64

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp