simplexml_import_dom
Function • Params changed in PHP 8.4
Get a SimpleXMLElement object from an XML or HTML node.
simplexml_import_dom Function synopsis
simplexml_import_dom(object $node, ?string $class_name = SimpleXMLElement::class): ?SimpleXMLElement
Parameters
$node
Typeobject
A DOM Element node
$class_name
OptionalType?stringDefault valueSimpleXMLElement::class
You may use this optional parameter so that
simplexml_import_dom will return an object of
the specified class. That class should extend the
SimpleXMLElement class.
Return value
Type?SimpleXMLElement
Returns a SimpleXMLElement or null on failure.
Changes to the simplexml_import_dom Function
PHP 8.4
- Parameter type changed for parameter #1 (
$node):SimpleXMLElement|DOMNodetoobject
- simplexml_import_dom(SimpleXMLElement|DOMNode $node, ?string $class_name = SimpleXMLElement::class): ?SimpleXMLElement
+ simplexml_import_dom(object $node, ?string $class_name = SimpleXMLElement::class): ?SimpleXMLElement PHP 8.0
- Return type added:
?SimpleXMLElement - Parameter type added for parameter #1 (
$node):SimpleXMLElement|DOMNode - Parameter type added for parameter #2 (
$class_name):?string - Parameter default value added for position #2 (
$class_name):SimpleXMLElement::class
- simplexml_import_dom($node, $class_name)
+ simplexml_import_dom(SimpleXMLElement|DOMNode $node, ?string $class_name = SimpleXMLElement::class): ?SimpleXMLElement simplexml_import_dom Function Availability
simplexml_import_dom Function Availability| PHP Version | Availability |
|---|---|
| PHP 8.6Upcoming Release | Yes |
| PHP 8.5Supported (Latest) | Yes |
| PHP 8.4Supported | Yes |
| PHP 8.3Security-Fixes Only | Yes |
| PHP 8.2Security-Fixes Only | Yes |
| PHP 8.1Unsupported | Yes |
| PHP 8.0Unsupported | Yes |
| PHP 7.4Unsupported | Yes |
| PHP 7.3Unsupported | Yes |
| PHP 7.2Unsupported | Yes |
| PHP 7.1Unsupported | Yes |
| PHP 7.0Unsupported | Yes |
| PHP 5.6Unsupported | Yes |
| PHP 5.5Unsupported | Yes |
| PHP 5.4Unsupported | Yes |
| PHP 5.3Unsupported | Yes |