3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $xml = <<< XML <?xml version="1.0" encoding="utf-8"?> <books> <book>Patterns of Enterprise Application Architecture</book> <book>Design Patterns: Elements of Reusable Software Design</book> <book>Clean Code</book> </books> XML; $dom = new DOMDocument; $dom->loadXML($xml); $books = $dom->getElementsByTagName('book'); echo count($books); foreach ($books as $book) { echo $book->nodeValue, PHP_EOL; }
Output for 7.2.0
3Patterns of Enterprise Application Architecture Design Patterns: Elements of Reusable Software Design Clean Code
Output for 5.3.19 - 7.1.10
1Patterns of Enterprise Application Architecture Design Patterns: Elements of Reusable Software Design Clean Code