3v4l.org

run code in 300+ PHP versions simultaneously
<?php //hmmmmm - temporarily :) libxml_use_internal_errors(true); $h = ' <!DOCTYPE html> <html><body> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"> <circle stroke-width="12" r="43" cx="50" cy="50" fill="none" stroke="#3A5"/> <circle r="6" cx="59" cy="23" fill="#000"/> <g stroke-linejoin="round" stroke-linecap="round" stroke-width="1" stroke="#000" fill="none" id = "blah"> <path d="M36,36c5,0,3,2,8-1c1,2,1,3,3,2c3,0-6,7-3,8c-4-2-9,2-14-2c4-3,4-4,5-7c5,0,8,2,12,1"/> <path fill="#000" d="M34,29h31c2,5,7,10,7,16l-8,1l8,1l-3,31l-5,-18l-11,18l5-34l-3-8z"/> <path stroke-width="2" d="M27,48h23M28,49h21l-3,28h-14l-4,-28h5l3,28h3v-28h5l-2,28m3-4h-13m-1-5h16m0-5h-16m-1-5h18m0-5h-19"/> </g> <path stroke="#F00" stroke-width="1"/> </svg> </body></html> '; $doc = new DomDocument; $doc->loadHTML($h); echo "elemet's tag name: " . $doc->getElementById('blah')->tagName . "\n";
Output for 5.6.0 - 5.6.40, 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.4, 8.3.6
elemet's tag name: g
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 elemet's tag name: g

preferences:
194.88 ms | 402 KiB | 287 Q