3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html = '<!doctype html> <html> <body> <img src="computerIcon.png"> </body> </html> '; $proxy = 'https://proxy.example.com/?url=https://domain.example.com/'; $xml = new DOMDocument("1.0", "utf-8"); $xml->loadHTML($html); foreach($xml->getElementsByTagName('img') as $item) { $item->setAttribute('src', $proxy . $item->getAttribute('src')); } $xml->formatOutput = true; echo $xml->saveHTML();

This is an error 500

Value for `_results` contains invalid data `array`


preferences:
166.06 ms | 1884 KiB | 10 Q