3v4l.org

run code in 300+ PHP versions simultaneously
<?php ob_start(); echo "<?xml version='1.0' encoding='UTF-8'?> <urlset xmlns='http://www.sitemaps.org/schemas/sitemap/0.9'>"; $db = JFactory::getDbo(); $query = "SELECT * FROM #__sh404sef_urls ORDER BY oldurl ASC"; $db->setQuery($query); $rows = $db->loadObjectList(); foreach ($rows as $row) { $SEFedurl = $row->oldurl; $date = date("Y-m-d"); $line = "<url> <loc>http://" . $_SERVER['HTTP_HOST'] . "/$SEFedurl</loc> <priority>1.00</priority> <changefreq>weekly</changefreq> <lastmod>$date</lastmod> </url>"; echo $line; } echo "</urlset>"; //mysqli_close($dbc); $toWrite = ob_get_clean(); $toWrite; // data generated from form, formatted to XML $fp = fopen('sitemap.xml', 'w'); fwrite($fp, $toWrite); fclose($fp); ?>
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
<?xml version='1.0' encoding='UTF-8'?> <urlset xmlns='http://www.sitemaps.org/schemas/sitemap/0.9'> Fatal error: Uncaught Error: Class "JFactory" not found in /in/PVVUa:10 Stack trace: #0 {main} thrown in /in/PVVUa on line 10
Process exited with code 255.
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.20, 7.2.0 - 7.2.33, 7.3.12 - 7.3.33, 7.4.0 - 7.4.33
<?xml version='1.0' encoding='UTF-8'?> <urlset xmlns='http://www.sitemaps.org/schemas/sitemap/0.9'> Fatal error: Uncaught Error: Class 'JFactory' not found in /in/PVVUa:10 Stack trace: #0 {main} thrown in /in/PVVUa on line 10
Process exited with code 255.
Output for 5.0.0 - 5.0.5, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17, 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.28
<?xml version='1.0' encoding='UTF-8'?> <urlset xmlns='http://www.sitemaps.org/schemas/sitemap/0.9'> Fatal error: Class 'JFactory' not found in /in/PVVUa on line 10
Process exited with code 255.
Output for 4.3.2 - 4.3.11, 4.4.0 - 4.4.9
<?xml version='1.0' encoding='UTF-8'?> <urlset xmlns='http://www.sitemaps.org/schemas/sitemap/0.9'> Fatal error: Undefined class name 'jfactory' in /in/PVVUa on line 10
Process exited with code 255.
Output for 4.3.0 - 4.3.1
<?xml version='1.0' encoding='UTF-8'?> <urlset xmlns='http://www.sitemaps.org/schemas/sitemap/0.9'> Fatal error: Undefined class name 'jfactory' in /in/PVVUa on line 10

preferences:
258.38 ms | 402 KiB | 355 Q