PHP 8.4.0 RC4 available for testing

DOMNode::isEqualNode

(PHP 8 >= 8.3.0)

DOMNode::isEqualNodeChecks that both nodes are equal

说明

public DOMNode::isEqualNode(?DOMNode $otherNode): bool

Checks that both nodes are equal.

参数

otherNode

The node.

返回值

Returns true if both nodes are equal, false otherwise.

示例

示例 #1 DOMNode::isEqualNode() example

<?php

$dom1
= (new DOMDocument())->createElement('h1', 'Hello World!');
$dom2 = (new DOMDocument())->createElement('h1', 'Hello World!');

var_dump($dom1->isEqualNode($dom2));
?>

以上示例会输出:

bool(true)
添加备注

用户贡献的备注

此页面尚无用户贡献的备注。
To Top