3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html = "<!doctype html><html><head></head><body></body></html>"; $dom = \Dom\HtmlDocument::createFromString($html); var_dump(\is_null($dom->querySelector("html"))); var_dump(\is_null($dom->querySelector("Html"))); var_dump(\is_null($dom->querySelector("HTML")));
Output for 8.4.1 - 8.4.14
bool(false) bool(true) bool(true)
Output for 8.2.0 - 8.2.29, 8.3.0 - 8.3.27
Fatal error: Uncaught Error: Class "Dom\HtmlDocument" not found in /in/e9JOn:3 Stack trace: #0 {main} thrown in /in/e9JOn on line 3
Process exited with code 255.

preferences:
59.95 ms | 407 KiB | 5 Q