3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = <<<DATA <p>Portable <span class="shlt">Adobe</span> <span class="shlt">After</span> <span class="shlt">Effects</span> CC <span class="shlt">2018</span> 15.1.1.12 (x64)</p> DATA; $dom = new DOMDocument(); $dom->loadHTML($data); var_dump($dom->getElementsByTagName("p")[0]); echo $dom->getElementsByTagName("p")[0]->textContent;
Output for 8.3.0 - 8.3.4, 8.3.6 - 8.3.7
object(DOMElement)#3 (27) { ["schemaTypeInfo"]=> NULL ["tagName"]=> string(1) "p" ["className"]=> string(0) "" ["id"]=> string(0) "" ["firstElementChild"]=> string(22) "(object value omitted)" ["lastElementChild"]=> string(22) "(object value omitted)" ["childElementCount"]=> int(4) ["previousElementSibling"]=> NULL ["nextElementSibling"]=> NULL ["nodeName"]=> string(1) "p" ["nodeValue"]=> string(53) "Portable Adobe After Effects CC 2018 15.1.1.12 (x64)" ["nodeType"]=> int(1) ["parentNode"]=> string(22) "(object value omitted)" ["parentElement"]=> string(22) "(object value omitted)" ["childNodes"]=> string(22) "(object value omitted)" ["firstChild"]=> string(22) "(object value omitted)" ["lastChild"]=> string(22) "(object value omitted)" ["previousSibling"]=> NULL ["nextSibling"]=> NULL ["attributes"]=> string(22) "(object value omitted)" ["isConnected"]=> bool(true) ["ownerDocument"]=> string(22) "(object value omitted)" ["namespaceURI"]=> NULL ["prefix"]=> string(0) "" ["localName"]=> string(1) "p" ["baseURI"]=> NULL ["textContent"]=> string(53) "Portable Adobe After Effects CC 2018 15.1.1.12 (x64)" } Portable Adobe After Effects CC 2018 15.1.1.12 (x64)
Output for 8.3.5
Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0 object(DOMElement)#3 (27) { ["schemaTypeInfo"]=> NULL ["tagName"]=> string(1) "p" ["className"]=> string(0) "" ["id"]=> string(0) "" ["firstElementChild"]=> string(22) "(object value omitted)" ["lastElementChild"]=> string(22) "(object value omitted)" ["childElementCount"]=> int(4) ["previousElementSibling"]=> NULL ["nextElementSibling"]=> NULL ["nodeName"]=> string(1) "p" ["nodeValue"]=> string(53) "Portable Adobe After Effects CC 2018 15.1.1.12 (x64)" ["nodeType"]=> int(1) ["parentNode"]=> string(22) "(object value omitted)" ["parentElement"]=> string(22) "(object value omitted)" ["childNodes"]=> string(22) "(object value omitted)" ["firstChild"]=> string(22) "(object value omitted)" ["lastChild"]=> string(22) "(object value omitted)" ["previousSibling"]=> NULL ["nextSibling"]=> NULL ["attributes"]=> string(22) "(object value omitted)" ["isConnected"]=> bool(true) ["ownerDocument"]=> string(22) "(object value omitted)" ["namespaceURI"]=> NULL ["prefix"]=> string(0) "" ["localName"]=> string(1) "p" ["baseURI"]=> NULL ["textContent"]=> string(53) "Portable Adobe After Effects CC 2018 15.1.1.12 (x64)" } Portable Adobe After Effects CC 2018 15.1.1.12 (x64)
Output for 8.1.0 - 8.1.28, 8.2.0 - 8.2.19
object(DOMElement)#3 (23) { ["schemaTypeInfo"]=> NULL ["tagName"]=> string(1) "p" ["firstElementChild"]=> string(22) "(object value omitted)" ["lastElementChild"]=> string(22) "(object value omitted)" ["childElementCount"]=> int(4) ["previousElementSibling"]=> NULL ["nextElementSibling"]=> NULL ["nodeName"]=> string(1) "p" ["nodeValue"]=> string(53) "Portable Adobe After Effects CC 2018 15.1.1.12 (x64)" ["nodeType"]=> int(1) ["parentNode"]=> string(22) "(object value omitted)" ["childNodes"]=> string(22) "(object value omitted)" ["firstChild"]=> string(22) "(object value omitted)" ["lastChild"]=> string(22) "(object value omitted)" ["previousSibling"]=> NULL ["nextSibling"]=> NULL ["attributes"]=> string(22) "(object value omitted)" ["ownerDocument"]=> string(22) "(object value omitted)" ["namespaceURI"]=> NULL ["prefix"]=> string(0) "" ["localName"]=> string(1) "p" ["baseURI"]=> NULL ["textContent"]=> string(53) "Portable Adobe After Effects CC 2018 15.1.1.12 (x64)" } Portable Adobe After Effects CC 2018 15.1.1.12 (x64)
Output for 8.0.0 - 8.0.30
object(DOMElement)#3 (23) { ["tagName"]=> string(1) "p" ["schemaTypeInfo"]=> NULL ["firstElementChild"]=> string(22) "(object value omitted)" ["lastElementChild"]=> string(22) "(object value omitted)" ["childElementCount"]=> int(4) ["previousElementSibling"]=> NULL ["nextElementSibling"]=> NULL ["nodeName"]=> string(1) "p" ["nodeValue"]=> string(53) "Portable Adobe After Effects CC 2018 15.1.1.12 (x64)" ["nodeType"]=> int(1) ["parentNode"]=> string(22) "(object value omitted)" ["childNodes"]=> string(22) "(object value omitted)" ["firstChild"]=> string(22) "(object value omitted)" ["lastChild"]=> string(22) "(object value omitted)" ["previousSibling"]=> NULL ["nextSibling"]=> NULL ["attributes"]=> string(22) "(object value omitted)" ["ownerDocument"]=> string(22) "(object value omitted)" ["namespaceURI"]=> NULL ["prefix"]=> string(0) "" ["localName"]=> string(1) "p" ["baseURI"]=> NULL ["textContent"]=> string(53) "Portable Adobe After Effects CC 2018 15.1.1.12 (x64)" } Portable Adobe After Effects CC 2018 15.1.1.12 (x64)
Output for 7.1.2 - 7.1.20, 7.2.0 - 7.2.33, 7.3.16 - 7.3.33, 7.4.0 - 7.4.33
object(DOMElement)#3 (18) { ["tagName"]=> string(1) "p" ["schemaTypeInfo"]=> NULL ["nodeName"]=> string(1) "p" ["nodeValue"]=> string(53) "Portable Adobe After Effects CC 2018 15.1.1.12 (x64)" ["nodeType"]=> int(1) ["parentNode"]=> string(22) "(object value omitted)" ["childNodes"]=> string(22) "(object value omitted)" ["firstChild"]=> string(22) "(object value omitted)" ["lastChild"]=> string(22) "(object value omitted)" ["previousSibling"]=> NULL ["nextSibling"]=> NULL ["attributes"]=> string(22) "(object value omitted)" ["ownerDocument"]=> string(22) "(object value omitted)" ["namespaceURI"]=> NULL ["prefix"]=> string(0) "" ["localName"]=> string(1) "p" ["baseURI"]=> NULL ["textContent"]=> string(53) "Portable Adobe After Effects CC 2018 15.1.1.12 (x64)" } Portable Adobe After Effects CC 2018 15.1.1.12 (x64)
Output for 7.1.0 - 7.1.1
object(DOMElement)#3 (17) { ["tagName"]=> string(1) "p" ["schemaTypeInfo"]=> NULL ["nodeName"]=> string(1) "p" ["nodeValue"]=> string(53) "Portable Adobe After Effects CC 2018 15.1.1.12 (x64)" ["nodeType"]=> int(1) ["parentNode"]=> string(22) "(object value omitted)" ["childNodes"]=> string(22) "(object value omitted)" ["firstChild"]=> string(22) "(object value omitted)" ["lastChild"]=> string(22) "(object value omitted)" ["previousSibling"]=> NULL ["attributes"]=> string(22) "(object value omitted)" ["ownerDocument"]=> string(22) "(object value omitted)" ["namespaceURI"]=> NULL ["prefix"]=> string(0) "" ["localName"]=> string(1) "p" ["baseURI"]=> NULL ["textContent"]=> string(53) "Portable Adobe After Effects CC 2018 15.1.1.12 (x64)" } Portable Adobe After Effects CC 2018 15.1.1.12 (x64)

preferences:
129.67 ms | 403 KiB | 164 Q