3v4l.org

run code in 300+ PHP versions simultaneously
<?php try { \Dom\HTMLDocument::createFromString('', options: LIBXML_HTML_NODEFDTD); } catch (\Throwable $e) { echo $e->__toString(); } \Dom\HTMLDocument::createFromString('', options: Dom\NO_DEFAULT_NS);
Output for 8.4.5 - 8.4.12
ValueError: Dom\HTMLDocument::createFromString(): Argument #2 ($options) contains invalid flags (allowed flags: LIBXML_NOERROR, LIBXML_COMPACT, LIBXML_HTML_NOIMPLIED, Dom\HTML_NO_DEFAULT_NS) in /in/pZj10:4 Stack trace: #0 /in/pZj10(4): Dom\HTMLDocument::createFromString('', 4) #1 {main} Fatal error: Uncaught Error: Undefined constant "Dom\NO_DEFAULT_NS" in /in/pZj10:8 Stack trace: #0 {main} thrown in /in/pZj10 on line 8
Process exited with code 255.
Output for 8.4.2 - 8.4.4
ValueError: Dom\HTMLDocument::createFromString(): Argument #2 ($options) contains invalid flags (allowed flags: LIBXML_NOERROR, LIBXML_COMPACT, LIBXML_HTML_NOIMPLIED, Dom\NO_DEFAULT_NS) in /in/pZj10:4 Stack trace: #0 /in/pZj10(4): Dom\HTMLDocument::createFromString('', 4) #1 {main} Fatal error: Uncaught Error: Undefined constant "Dom\NO_DEFAULT_NS" in /in/pZj10:8 Stack trace: #0 {main} thrown in /in/pZj10 on line 8
Process exited with code 255.
Output for 8.1.32, 8.2.27 - 8.2.29, 8.3.5 - 8.3.25
Error: Class "Dom\HTMLDocument" not found in /in/pZj10:4 Stack trace: #0 {main} Fatal error: Uncaught Error: Class "Dom\HTMLDocument" not found in /in/pZj10:8 Stack trace: #0 {main} thrown in /in/pZj10 on line 8
Process exited with code 255.

preferences:
42.04 ms | 409 KiB | 5 Q