3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?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 7.0.0 - 7.1.0
<?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.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.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