3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml = <<< XML <?xml version="1.0" encoding="utf-8"?> <books> <book>Patterns of Enterprise Application Architecture</book> <book></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'); $length = $books->length; $break = FALSE; foreach ($books as $k => $book) { var_dump(empty($book->nodeValue)); if($break){ echo $book->nodeValue; if($k == ($length-1)) { echo "last iteration: " . $book->nodeValue; } else { break; } } if(empty($book->nodeValue)) { $break = TRUE; break; } echo $book->nodeValue, PHP_EOL; }
Output for git.master, git.master_jit, rfc.property-hooks
bool(false) Patterns of Enterprise Application Architecture bool(true)

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
57.08 ms | 401 KiB | 8 Q