3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A extends DOMDocument { const TEST = false; public function loadXml() { var_dump(static::TEST); } } class B extends A { const TEST = true; } $b = new B; $b->loadXml();
Output for 8.3.0 - 8.3.6
Fatal error: Declaration of A::loadXml() must be compatible with DOMDocument::loadXML(string $source, int $options = 0): bool in /in/OlH17 on line 6
Process exited with code 255.
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18
Fatal error: Declaration of A::loadXml() must be compatible with DOMDocument::loadXML(string $source, int $options = 0) in /in/OlH17 on line 6
Process exited with code 255.
Output for 7.4.0 - 7.4.33
Warning: Declaration of A::loadXml() should be compatible with DOMDocument::loadXML($source, $options = NULL) in /in/OlH17 on line 6 bool(true)
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.20, 7.2.0 - 7.2.33, 7.3.16 - 7.3.33
Warning: Declaration of A::loadXml() should be compatible with DOMDocument::loadXML($source, $options = NULL) in /in/OlH17 on line 10 bool(true)
Output for 5.5.24 - 5.5.35, 5.6.8 - 5.6.28
Strict Standards: Declaration of A::loadXml() should be compatible with DOMDocument::loadXML($source, $options = NULL) in /in/OlH17 on line 10 bool(true)

preferences:
176.33 ms | 402 KiB | 181 Q