3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml = <<<XML <?xml version="1.0"?> <a> <b> <c> <value>Some Value</value> </c> </b> </a> XML; $a = new SimpleXMLElement($xml); $nodes = $a->xpath('/a/b/c/value'); $node = $nodes[0]; if ($node) { echo "Element is not empty"; } else { echo "Element is empty"; } var_dump((array)$node);

preferences:
38.79 ms | 402 KiB | 5 Q